lkml.org 
[lkml]   [2010]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH] net/ipv4/fib_semantics.c: quiet sparse "shadows" noise
Date
From
On Friday, January 15, 2010 2:18 AM, David Miller wrote:
> From: H Hartley Sweeten <hartleys@visionengravers.com>
> Date: Thu, 14 Jan 2010 16:52:41 -0700
>
>> net/ipv4/fib_semantics.c: quiet sparse "shadows" noise
>>
>> If CONFIG_IP_ROUTE_MULTIPATH is defined the symbol 'nh' is
>> declared twice in the function fib_sync_down_dev. First as the
>> loop variable used to iterate the hlist. Then again due to the
>> change_nexthops macro. This produces a sparse warning and
>> makes the code harder to understand.
>>
>> Fix the issue by renaming the first symbol.
>>
>> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
>
> I think it's easier to fix this by using a less simple name
> in change_nexthops(), so I'll deal with this using the following
> patch.

OK. The patch is larger but it's much clearer this way.

> Thanks for reporting this:
>
> ipv4: Use less conflicting local var name in change_nexthops() loop macro.
>
> As noticed by H Hartley Sweeten, since change_nexthops() uses 'nh'
> as it's iterator variable, it can conflict with other existing
> local vars.
>
> Use "nexthop_nh" to avoid the conflict and make it easier to figure
> out where this magic variable comes from.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>

Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>


\
 
 \ /
  Last update: 2010-01-15 18:01    [from the cache]
©2003-2011 Jasper Spaans