Fixing trivial warnings

Nelson Castillo nelsoneci at gmail.com
Thu Oct 16 15:35:12 CEST 2008


On Thu, Oct 16, 2008 at 7:53 AM, Nelson Castillo <nelsoneci at gmail.com> wrote:
> On Thu, Oct 16, 2008 at 1:01 AM, Jonas Bonn <jonas.bonn at gmail.com> wrote:
>> On Thu, Oct 16, 2008 at 5:00 AM, Nelson Castillo <nelsoneci at gmail.com> wrote:
>>> From: Nelson Castillo <nelsoneci at gmail.com>
>>>
>>> This patch fixes: 'scratch' may be used uninitialized in this function.
>>> Let's add a remark because this initialization might be confusing.
>>>        unsigned long flags;
>>>        size_t blksize, len, chunk;
>>> -       u32 scratch;
>>> +       u32 scratch = 0; /* avoid warning - initialization below */
>>>        u8 *buf;
>>>
>>>        DBG("PIO reading\n");
>>>
>>>
>>
>> I would have moved the definition of scratch to be inside the
>> while-loop where the variable is used.
>
> Hello Jonas.
>
> I thought of it but the variable has to survive "while (blksize)". Right?

Well, already fixed upstream.

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=drivers/mmc/host/sdhci.c;hb=HEAD

    u32 uninitialized_var(scratch);

For now I should only care about what we are carrying.

Thanks for your remarks :-)



More information about the openmoko-kernel mailing list