From: Wolfgang Denk Date: Thu, 16 May 2013 07:55:16 +0200 Subject: [U-Boot] [PATCH] mmc and fat bug fixes In-Reply-To: <15AE5A936F5E3A42A9144E66875A0A89308F2E@server1-derijp.CLB-Benelux.lokaal> References: <15AE5A936F5E3A42A9144E66875A0A89308F2E@server1-derijp.CLB-Benelux.lokaal> Message-ID: <20130516055516.AD7BB380E72@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Ruud Commandeur, In message <15AE5A936F5E3A42A9144E66875A0A89308F2E@server1-derijp.CLB-Benelux.lokaal> you wrote: > This patch fixes a number of mmc and fat-related bugs: > > > Added a check for blkcnt > 0 in mmc_write_blocks (drivers/mmc.c) to preve= > nt a hangup for further mmc commands. > > > Solved a checksum issue in fs/fat/fat.c. The mkcksum has const char argum= > ents with a size specifier, like "const char name[8]". In the function, it = > is assumed that sizeof(name) will have the value 8, but this is not the cas= > e (at least not for the Sourcery CodeBench compiler and probably not accord= > ing to ANSI C). This causes "long filename checksum errors" for each fat fi= > le listed or written. Please explain. Under which exact conditions would sizeof(name) not be 8, and where is such assumption supported in ANSI C? I am tempted to NAK the FAT changes, as they make the code much harder to read and to maintain. Using this simple test program: ----- snip ---- #include int main(void) { const char name[8]; const char ext[3]; printf("sizeof(name)=%d, expected 8\n", sizeof(name)); printf("sizeof(ext) =%d, expected 3\n", sizeof(name)); return 0; } ----- snip ---- I get the expected values on all systems and with all compilers I tested. For which exact configuration do you get different results? > > Made some changes to fs/fat/fat_write.c. Fixed testing fat_val for 0xffff= > /0xfff8 and 0xfffffff/0xffffff8 by adding the corresponding fatsize in the = > test (as read in earlier posts) and some changes in debug output. Please restrict your line length in commit messages to some 70 characters or so. > Signed-off-by: Ruud Commandeur > Cc: Tom Rini > Cc: Beno=EEt Th=E9baudeau > Cc: Mats Karrman Please split into three separate patches, one for MMX, and two for FAT, one for each problem. And make sure to add the MMC custodian on Cc: Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The existence of god implies a violation of causality.