On Wednesday 19 October 2011 18:30:58 Doug Anderson wrote:
> --- a/common/cmd_bootm.c
> +++ b/common/cmd_bootm.c
>
> +static char *do_fixup_silent_linux(const char *cmdline)
> +{
> +     int bufsize;

size_t

> +     /*
> +      * Allocate enough space for:
> +      * - a copy of the command line
> +      * - a space
> +      * - a blank "console=" argument
> +      * - the '\0'
> +      *
> +      * ...we might not need all this space, but it's OK to overallocate a
> +      * little.
> +      */
> +     bufsize = strlen(cmdline) + 1 + sizeof("console=");

relying on the sizeof() to include the NUL byte calculation seems like it 
could confuse some.  how about:
        strlen(cmdline) + 1 + strlen("console=") + 1;
gcc should optimize that into a constant anyways.

> +     strcpy(buf, cmdline);
> +     do {
> +             did_remove  = remove_cmdline_param(buf, "console");
> +     } while (did_remove);
> +     add_cmdline_param(buf, "console=", bufsize);

this is different behavior from what was there before.  the previous code only 
removed the first console= and not all of them.  i've relied on this behavior 
in the past, so i'm not sure you should change it.  at least not without a 
dedicated commit rather than merging it with a commit that's supposed to just 
change the code to use the new remove_cmdline_param() helper.
-mike

Attachment: 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

Reply via email to