On Monday, June 20, 2011 10:10:16 Lei Wen wrote: > + if (state == MMC_ERASE) { > + blk = simple_strtoul(argv[2], NULL, 16); > + cnt = simple_strtoul(argv[3], NULL, 16); > + } else { > + addr = (void *)simple_strtoul(argv[2], NULL, 16); > + blk = simple_strtoul(argv[3], NULL, 16); > + cnt = simple_strtoul(argv[4], NULL, 16); > + }
you could do: char **args = &argv[2]; if (state != MMC_ERASE) { addr = (void *)simple_strtoul(args[0], NULL, 16); ++args; } else addr = 0; blk = simple_strtoul(args[0], NULL, 16); simple_strtoul(args[1], NULL, 16); > + "mmc erase addr blk# cnt\n" i dont think the "erase" cmd takes an addr > +err_out: > + printf("mmc erase failed\n\r"); dont use \r in strings, and use puts() -mike
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot