public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 6/7] FAT: Simplify get_contents
@ 2012-07-19 22:02 Benoît Thébaudeau
  2012-07-20 13:21 ` [U-Boot] [PATCH v2 7/8] " Benoît Thébaudeau
  0 siblings, 1 reply; 10+ messages in thread
From: Benoît Thébaudeau @ 2012-07-19 22:02 UTC (permalink / raw)
  To: u-boot

One call to get_cluster can be factorized with another, so avoid duplicating
code.

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
---
 .../fs/fat/fat.c                                   |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git u-boot-66714b1.orig/fs/fat/fat.c u-boot-66714b1/fs/fat/fat.c
index 4c80820..8ac8b85 100644
--- u-boot-66714b1.orig/fs/fat/fat.c
+++ u-boot-66714b1/fs/fat/fat.c
@@ -368,21 +368,9 @@ get_contents (fsdata *mydata, dir_entry *dentptr, __u8 *buffer,
 			actsize += bytesperclust;
 		}
 
-		/* actsize >= file size */
-		actsize -= bytesperclust;
-
-		/* get remaining clusters */
-		if (get_cluster(mydata, curclust, buffer, (int)actsize) != 0) {
-			printf("Error reading cluster\n");
-			return -1;
-		}
-
 		/* get remaining bytes */
-		gotsize += (int)actsize;
-		filesize -= actsize;
-		buffer += actsize;
 		actsize = filesize;
-		if (get_cluster(mydata, endclust, buffer, (int)actsize) != 0) {
+		if (get_cluster(mydata, curclust, buffer, (int)actsize) != 0) {
 			printf("Error reading cluster\n");
 			return -1;
 		}

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-09-05  0:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-19 22:02 [U-Boot] [PATCH 6/7] FAT: Simplify get_contents Benoît Thébaudeau
2012-07-20 13:21 ` [U-Boot] [PATCH v2 7/8] " Benoît Thébaudeau
2012-09-02 15:25   ` Wolfgang Denk
2012-09-04 20:50     ` Tom Rini
2012-09-04 22:07       ` Benoît Thébaudeau
2012-09-04 22:10         ` Tom Rini
2012-09-04 22:41           ` Tom Rini
2012-09-04 22:53           ` Benoît Thébaudeau
2012-09-05  0:03             ` Tom Rini
2012-09-04 22:08       ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox