[PATCH v2 1/2] mtd-utils: nanddump/nandwrite: style, signed-ness, printing fixups

Mike Frysinger vapier.adi at gmail.com
Thu Oct 21 03:37:00 EDT 2010


On Thu, Oct 21, 2010 at 03:19, Brian Norris wrote:
> There were some signed/unsigned integer comparisons. Their types were
> changed for safety. Also, "strtol" was improperly used for unsigned
> data types.

dont really like these being merged, but that's obviously Artem's call, not mine

> -       while (lx < (linebuflen - 1) && lx < (ascii_column - 1))
> +       do {
>                linebuf[lx++] = ' ';
> +       } while (lx < (linebuflen - 1) && lx < (ascii_column - 1));

hmm, unrelated to your changes, but i'm pretty sure this can be
rewritten into a sprintf ...
  sprintf(linebuf + lx, "%*s", (linebuflen - 1) - lx, "")
and integrating the ascii_column stuff too.  or maybe that's too complicated.
-mike



More information about the linux-mtd mailing list