lkml.org 
[lkml]   [2013]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] tty/serial: Fix uninitialized variable warning
On Fri, Mar 15, 2013 at 8:30 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Mon, Mar 04, 2013 at 09:35:07AM +0800, Grant Likely wrote:
>> drivers/tty/serial/8250/8250.c: In function 'serial_unlink_irq_chain':
>> drivers/tty/serial/8250/8250.c:1676:19: warning: 'i' may be used uninitialized in this function
>>
>> There isn't an actual bug here since the function tests the condition
>> that would cause i to be uninitialized before dereferencing i. However,
>> at least some versions of GCC complain as shown above. (in my case,
>> powerpc gcc 2.5.2). Initializing i to NULL makes it clear to GCC and the
>> casual code reviewer that i will not be dereferenced to a random
>> address.
>>
>> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> ---
>> Greg, some may argue that this is a tool problem, not a kernel problem,
>> but it is useful to me. If anyone objects I'm not going to spend any
>> time championing for this patch.
>
> Upgrade your tools to ones that work properly :)

FWIW, it's still a toolchain that a lot of people use for embedded
powerpc development.

g.


\
 
 \ /
  Last update: 2013-03-15 23:21    [W:0.060 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site