Fixing trivial warnings
nelsoneci at gmail.com
Thu Oct 16 14:53:18 CEST 2008
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.
I thought of it but the variable has to survive "while (blksize)". Right?
More information about the openmoko-kernel