
23 Jun
2011
23 Jun
'11
5:05 a.m.
Hi Mike,
On Thu, Jun 23, 2011 at 12:57 AM, Mike Frysinger vapier@gentoo.org wrote:
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()
Thanks for comments, new version pushed with your suggestion involved.
Best regards, Lei