On 10/22/2012 06:49 PM, Andrew Morton wrote:
> On Tue, 16 Oct 2012 15:53:39 -0500
> [email protected] wrote:
>
>> From: Corey Minyard <[email protected]>
>>
>> There was a spot where the compiler couldn't tell some variables
>> would be set.  So initialize them to make the warning go away.
>>
>> Signed-off-by: Corey Minyard <[email protected]>
>> ---
>>   drivers/char/ipmi/ipmi_msghandler.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/char/ipmi/ipmi_msghandler.c 
>> b/drivers/char/ipmi/ipmi_msghandler.c
>> index 2c29942..a0c84bb 100644
>> --- a/drivers/char/ipmi/ipmi_msghandler.c
>> +++ b/drivers/char/ipmi/ipmi_msghandler.c
>> @@ -1880,7 +1880,7 @@ int ipmi_request_supply_msgs(ipmi_user_t          user,
>>                           struct ipmi_recv_msg *supplied_recv,
>>                           int                  priority)
>>   {
>> -    unsigned char saddr, lun;
>> +    unsigned char saddr = 0, lun = 0;
>>      int           rv;
>>   
>>      if (!user)
> The kernel build actually generates quite a lot of "bar uninitialised"
> warnings for foo(&bar) expressions.  I just ignore them, because later
> versions of gcc stopped doing that.
>
> The fix is OK, I suppose.  But it will cause additional code to be
> emitted.  Using uninitialized_var() avoids that, and makes things
> clearer to the reader.
Well, warnings annoy me, especially when I get the emails about them.  
But I suppose that's the point of the emails :).

I'll do a patch to switch it to uninitialized_var() for the next set of 
things I send.  Thanks.

-corey


------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to