[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
On Friday, January 15, 2010 2:18 AM, David Miller wrote:
> From: H Hartley Sweeten <>
> 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 <>
> 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 <>

Tested-by: H Hartley Sweeten <>

 \ /
  Last update: 2010-01-15 18:01    [W:0.052 / U:0.472 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site