Hello. On 13-09-2010 8:06, Lei Wen wrote:
> Signed-off-by: Lei Wen<lei...@marvell.com> > --- > drivers/mmc/mmc.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > index cf4ea16..5ff1c54 100644 > --- a/drivers/mmc/mmc.c > +++ b/drivers/mmc/mmc.c > @@ -92,6 +92,11 @@ mmc_bwrite(int dev_num, ulong start, lbaint_t blkcnt, > const void*src) > > blklen = mmc->write_bl_len; > > + if (start > mmc->block_dev.lba || (start + blkcnt) > > mmc->block_dev.lba) { The second comparison should suffice, no? Also, parens are not necessary. > + puts("operation exceed mmc boundary..\n > + This devices only have 0x%x blocks\n", > mmc->block_dev.lba); Where's the cloging quote? String literals are not broken up like this -- this adds extra spaces to them. Should be: puts("operation exceed mmc boundary..\n" "This devices only have 0x%x blocks\n", mmc->block_dev.lba); > + return 0; > + } > err = mmc_set_blocklen(mmc, mmc->write_bl_len); > > if (err) { > @@ -219,6 +224,11 @@ static ulong mmc_bread(int dev_num, ulong start, > lbaint_t blkcnt, void *dst) > if (!mmc) > return 0; > > + if (start > mmc->block_dev.lba || (start + blkcnt) > > mmc->block_dev.lba) { > + puts("operation exceed mmc boundary..\n > + This devices only have 0x%x blocks\n", mmc->block_dev.lba); Same comments here... WBR, Sergei _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot