Patchwork [U-Boot,v2,2/4] fs/fat: Don't multiply fatsize with sector size

login
register
mail settings
Submitter egbert.eich@gmail.com
Date April 10, 2013, 7:11 a.m.
Message ID <1365577917-32563-3-git-send-email-egbert.eich@gmail.com>
Download mbox | patch
Permalink /patch/235312/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

egbert.eich@gmail.com - April 10, 2013, 7:11 a.m.
From: Egbert Eich <eich@suse.com>

Bugfix:
Here at this place we need the fat size in sectors not bytes.
This was found during code review when adding support for storage
devices with blocksizes != 512.

Signed-off-by: Egbert Eich <eich@suse.com>
---
Changes for v2:                                                               
  - Coding style fixes.                                                       

 fs/fat/fat_write.c | 1 -
 1 file changed, 1 deletion(-)
Tom Rini - May 2, 2013, 4:07 p.m.
On Tue, Apr 09, 2013 at 09:11:55PM -0000, egbert.eich@gmail.com wrote:

> From: Egbert Eich <eich@suse.com>
> 
> Bugfix:
> Here at this place we need the fat size in sectors not bytes.
> This was found during code review when adding support for storage
> devices with blocksizes != 512.
> 
> Signed-off-by: Egbert Eich <eich@suse.com>

Applied to u-boot/master, thanks!

Patch

diff --git a/fs/fat/fat_write.c b/fs/fat/fat_write.c
index b4022aa..fd07240 100644
--- a/fs/fat/fat_write.c
+++ b/fs/fat/fat_write.c
@@ -120,7 +120,6 @@  static int flush_fat_buffer(fsdata *mydata)
 	__u8 *bufptr = mydata->fatbuf;
 	__u32 startblock = mydata->fatbufnum * FATBUFBLOCKS;
 
-	fatlength *= mydata->sect_size;
 	startblock += mydata->fat_sect;
 
 	if (getsize > fatlength)