RE: [PATCH] net/ipv4/fib_semantics.c: quiet sparse "shadows" noise

From: H Hartley Sweeten
Date: Fri Jan 15 2010 - 11:57:50 EST

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

Tested-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at