[U-Boot] [PATCH] cmd_nand.c: converted to new style subcmd handling

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Wed May 5 08:01:02 CEST 2010


Was afk for 3.5 weeks, so didn't get to this.Sorry.

2010/4/19 Scott Wood <scottwood at freescale.com>:
> On Sun, Apr 04, 2010 at 09:53:16PM +0200, Frans Meulenbroeks wrote:
>> converted to new style subcmd handling.
>> partly tested on sheevaplug
>> read and information commands tested on sheevaplug
>> (sorry did not want to nuke my device so I did not want to
>> test things like nand scrub)
>>
>> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>
>
> Sorry for the delay...
>
>> +static int do_nand_read(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
>> +{
>
> The read and write functions are quite similar, and were not duplicated
> previously.  Use one function, distinguishing with argv[0] (i.e. use subcmd
> only where it makes sense).

Cool. didn't think of using argv[0] here. Will do.

>
> Likewise for erase and scrub.

Ok.
>
>> +     if (argc < 4)
>> +     {
>> +             cmd_usage(cmdtp);
>> +             return 1;
>>       }
>
> The opening brace should be on the same line as the "if".

Oops. sorry, will fix. Might take a little time as lots of things pile
up in 3.5 weeks ....

Thanks for the feedback.

Frans


More information about the U-Boot mailing list