On Wed, May 15, 2013 at 9:23 AM, Ruud Commandeur <[email protected]> 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 > prevent a hangup for further mmc commands. > You need more information than that. Why is some code requesting 0-byte data commands? As others mentioned, you need to break up patches so each change is one patch. > Index: drivers/mmc/mmc.c > =================================================================== > --- drivers/mmc/mmc.c (revision 9) > +++ drivers/mmc/mmc.c (working copy) > @@ -282,8 +282,9 @@ > > if (blkcnt > 1) > cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK; > - else > + else if (blkcnt > 0) > cmd.cmdidx = MMC_CMD_WRITE_SINGLE_BLOCK; > + else return 0; //Called with blkcnt = 0 > Assuming this is necessary, I think it then might be time to reorder this: if (!blkcnt) <-- possibly at the very start of the function. return 0; if (blkcnt == 1) cmd.cmdidx = MMC_CMD_WRITE_SINGLE_BLOCK; else cmd.cmdidx = MMC_CMD_WRITE_MULTIPLE_BLOCK; While technically correct, checking >1, then >0 creates an odd dissonance in my mind, and makes me have to think about when that if clause will evaluate to true, and I hate having to think. :) Andy
_______________________________________________ U-Boot mailing list [email protected] http://lists.denx.de/mailman/listinfo/u-boot

