From: Mike Frysinger Date: Sat, 28 Mar 2009 06:15:06 -0400 Subject: [U-Boot] [PATCH] cmd_mmc: add support device command for selecting mmc device In-Reply-To: <49CDAFCA.1000508@samsung.com> References: <49CDAFCA.1000508@samsung.com> Message-ID: <200903280615.07849.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday 28 March 2009 01:04:10 Minkyu Kang wrote: > + case 2: > + if (strncmp(argv[1], "init", 4) == 0) { > + } else if (strncmp(argv[1], "dev", 3) == 0) { why strncmp ? i dont think it makes sense to support "init", "init.moo" "initaksldfjaksldfjasdf" ... > + printf("No MMC card found\n"); no format modifiers -> use puts() > + if (curr_device < 0) { > + printf("no MMC devices available\n"); puts("No MMC card selected\n"); > + case 3: considering how much code is duplicated with "case 2", seems like it would make sense to unify them and have each piece check the argc > U_BOOT_CMD( > - mmcinit, 1, 0, do_mmc, > - "init mmc card", > - NULL > + mmc, 3, 1, do_mmc, > + "MMC sub-system", > + "mmc init [dev] - init MMC sub system\n" first usage string should omit the command. run 'help mmc' on the board to see why ... -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20090328/1504de03/attachment.pgp