public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tien Fong Chee <tfchee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] fs/fat/fat: Optimizes memory size with single global variable instead of 3
Date: Wed, 13 Jul 2016 02:01:10 -0700	[thread overview]
Message-ID: <1468400470-28485-2-git-send-email-tfchee@altera.com> (raw)
In-Reply-To: <1468400470-28485-1-git-send-email-tfchee@altera.com>

Single 64KB get_contents_vfatname_block global variable would be used for
all FAT implementation instead of allocating additional two global variables
which are get_denfromdir_block and do_fat_read_at_block. This implementation
can help in saving up 128KB memory space.

Signed-off-by: Tien Fong Chee <tfchee@altera.com>
Cc: Dinh Nguyen <dinguyen@opensource.altera.com>
Cc: Dinh Nguyen <dinh.linux@gmail.com>
Cc: ChinLiang <clsee@altera.com>
Cc: Vagrant Cascadian <vagrant@debian.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stephen Warren <swarren@nvidia.com>
Cc: Beno?t Th?baudeau <benoit@wsystem.com>
---
 fs/fat/fat.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 826bd85..5d1afe6 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -579,8 +579,7 @@ static __u8 mkcksum(const char name[8], const char ext[3])
  * Get the directory entry associated with 'filename' from the directory
  * starting at 'startsect'
  */
-__u8 get_dentfromdir_block[MAX_CLUSTSIZE]
-	__aligned(ARCH_DMA_MINALIGN);
+__u8 *get_dentfromdir_block = get_contents_vfatname_block;
 
 static dir_entry *get_dentfromdir(fsdata *mydata, int startsect,
 				  char *filename, dir_entry *retdent,
@@ -811,8 +810,7 @@ exit:
 	return ret;
 }
 
-__u8 do_fat_read_at_block[MAX_CLUSTSIZE]
-	__aligned(ARCH_DMA_MINALIGN);
+__u8 *do_fat_read_at_block = get_contents_vfatname_block;
 
 int do_fat_read_at(const char *filename, loff_t pos, void *buffer,
 		   loff_t maxsize, int dols, int dogetsize, loff_t *size)
-- 
1.7.7.4

  reply	other threads:[~2016-07-13  9:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13  9:01 [U-Boot] [PATCH 1/2] fs/fat/fatwrite: Local variable as buffer to store dir_slot entries Tien Fong Chee
2016-07-13  9:01 ` Tien Fong Chee [this message]
2016-07-13 10:56   ` [U-Boot] [PATCH 2/2] fs/fat/fat: Optimizes memory size with single global variable instead of 3 Benoît Thébaudeau
2016-07-14 10:48     ` Tien Fong Chee
2016-07-14 23:37       ` Benoît Thébaudeau
2016-07-19  3:53         ` Tien Fong Chee
2016-07-19 16:25           ` Stephen Warren
2016-07-14 21:00 ` [U-Boot] [PATCH 1/2] fs/fat/fatwrite: Local variable as buffer to store dir_slot entries Stephen Warren
2016-07-19  3:24   ` Tien Fong Chee

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=1468400470-28485-2-git-send-email-tfchee@altera.com \
    --to=tfchee@altera.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