Subject: Re: [PATCH] netlink: silence compiler warning

From: Jarek Poplawski <[email-masked]>
Date: Sat, 05 Sep 2009 09:52:40 +0200

David Miller wrote, On 09/05/2009 05:33 AM:

> From: Brian Haley <[email-masked]>
> Date: Fri, 04 Sep 2009 21:36:06 -0400
> 
>> Hi Marcel,
>>
>> Marcel Holtmann wrote:
>>> can we please add the err = -E... where it actually is needed and not
>>> stupidly go ahead and silence compiler warnings with err = 0. This has
>>> been posted before.
>> Sorry, I don't remember it being posted before.  If you look at the code
>> though, err is correctly initialized, gcc just can't figure it out.  The
>> choices I see are either what I originally posted, using uninitialized_var(err),
>> or the patch below.  It doesn't matter to me.
> 
> uninitialized_var() would be absolutely wrong here, as then we'd
> return garbage if such a path were actually possible.

If the main "thesis" of the patch is:

> From following the code 'err' is initialized, but set it to zero to
> silence the warning.

"we" should better be sure it "is initialized", so considering: "if such
a path were actually possible" "would be absolutely wrong here"...

Here is a link to the message which proved something else was possible
at some moment in -next (I didn't check the current code yet):

From: Stephen Rothwell <[email-masked]>
Subject: Re: [PATCH] Fix Warnings from net/netlink/genetlink.c
Date: Wed, 12 Aug 2009 13:50:31 +1000

Archived-At: http://permalink.gmane.org/gmane.linux.kernel.next/8786

Jarek P.