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

Brian Norris computersforpeace at gmail.com
Thu Oct 21 11:54:06 EDT 2010


Hi,

I just want to be clear in communication this time, so I have a few
clarification questions.

On 10/21/2010 12:37 AM, Mike Frysinger wrote:
> 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

What exactly do you not like? The use of unsigned types, the use of
strtoul, a lack of consistency, or something else? I'm open to changing
my type usages if you have ideas that make more sense.

>> -       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.


I can look try that in the future. You're probably right though. When I
wrote this, I really just copied/pasted/fixed the library hexdump code
from the linux kernel, so I didn't spend time making it the simplest
possible.

Thanks,
Brian



More information about the linux-mtd mailing list