[U-Boot] [PATCH 7/7] GCC4.6: Squash warning in cmd_mem.c

Simon Glass sjg at chromium.org
Mon Sep 26 21:13:50 CEST 2011


Hi Marek,

On Mon, Sep 26, 2011 at 12:10 PM, Marek Vasut <marek.vasut at gmail.com> wrote:
> On Monday, September 26, 2011 09:01:16 PM Simon Glass wrote:
>> Hi Marek,
>>
>>
>> The assignment to i I was referring to is here:
>>
>>       if (length == 1) {
>>               if (size == 4) {
>>                       longp = (uint *)addr;
>>                       for (;;)
>>                               i = *longp;
>>                               ^^^ this line
>>
>>               }
>>               if (size == 2) {
>>                       shortp = (ushort *)addr;
>>                       for (;;)
>>                               i = *shortp;
>>                               ^^^ this line
>>
>>               }
>>               cp = (u_char *)addr;
>>               for (;;)
>>                       i = *cp;
>>                               ^^^ this line
>>
>>       }
>>
>> I was wondering if we need to assign to i? The output code appears
>> unchanged with my compiler if the 'i =' is removed.
>
> Oh, right ... this can be removed. That code seems quite legacy and in a urgent
> need of cleanup. Shall we wrap this change into this patch or do a subsequent
> one ?

I'm sure you know better than me, but it feels like a separate commit
if only because your commit msg is about GCC 4.6 warnings.

Regards,
Simon

>
> Cheers


More information about the U-Boot mailing list