From: Rob Clark <robdclark@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH please test] fs/fat: reduce stack usage for SPL
Date: Sun, 17 Sep 2017 09:38:04 -0400 [thread overview]
Message-ID: <20170917133807.16819-1-robdclark@gmail.com> (raw)
It seems like stack usage is a problem for SPL builds. So move itrblock
off the stack.
Please test this and see if it helps w/ current issues with SPL builds.
Long term, I'm not sure if it is better to do this conditional on SPL
builds, or move to malloc()? At any rate, if this fixes SPL builds it
should be a perfectly ok short term solution.
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
fs/fat/fat.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index f0284398b4..93140c9bcb 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -1031,10 +1031,12 @@ int file_fat_detectfs(void)
return 0;
}
+static fat_itr itrblock;
+
int fat_exists(const char *filename)
{
fsdata fsdata;
- fat_itr itrblock, *itr = &itrblock;
+ fat_itr *itr = &itrblock;
int ret;
ret = fat_itr_root(itr, &fsdata);
@@ -1049,7 +1051,7 @@ int fat_exists(const char *filename)
int fat_size(const char *filename, loff_t *size)
{
fsdata fsdata;
- fat_itr itrblock, *itr = &itrblock;
+ fat_itr *itr = &itrblock;
int ret;
ret = fat_itr_root(itr, &fsdata);
@@ -1081,7 +1083,7 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
loff_t maxsize, loff_t *actread)
{
fsdata fsdata;
- fat_itr itrblock, *itr = &itrblock;
+ fat_itr *itr = &itrblock;
int ret;
ret = fat_itr_root(itr, &fsdata);
--
2.13.5
next reply other threads:[~2017-09-17 13:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-17 13:38 Rob Clark [this message]
2017-09-17 13:42 ` [U-Boot] [PATCH please test] fs/fat: reduce stack usage for SPL Tom Rini
2017-09-17 13:50 ` Adam Ford
2017-09-22 13:02 ` [U-Boot] [PATCHv2] fs/fat: Reduce stack usage Tom Rini
2017-09-22 14:20 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170917133807.16819-1-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox