* [PATCH] net/ipv4/fib_semantics.c: fix "symbol shadows an earlier one" noise
@ 2009-08-05 0:36 H Hartley Sweeten
0 siblings, 0 replies; only message in thread
From: H Hartley Sweeten @ 2009-08-05 0:36 UTC (permalink / raw)
To: Linux Kernel
fib_sync_down_dev() uses a variable named 'nh' when doing a
hlist_for_each_entry loop. Later the same variable name is used
in a change_nexthops loop. This results in a sparse warning and is
potentially confusing. Fix both issues by changing the name of
the outer loop variable. The sparse warning is:
warning: symbol 'nh' shadows an earlier one
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
---
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 9b096d6..b0e485a 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1065,17 +1065,17 @@ int fib_sync_down_dev(struct net_device *dev, int force)
unsigned int hash = fib_devindex_hashfn(dev->ifindex);
struct hlist_head *head = &fib_info_devhash[hash];
struct hlist_node *node;
- struct fib_nh *nh;
+ struct fib_nh *this_nh;
if (force)
scope = -1;
- hlist_for_each_entry(nh, node, head, nh_hash) {
- struct fib_info *fi = nh->nh_parent;
+ hlist_for_each_entry(this_nh, node, head, nh_hash) {
+ struct fib_info *fi = this_nh->nh_parent;
int dead;
BUG_ON(!fi->fib_nhs);
- if (nh->nh_dev != dev || fi == prev_fi)
+ if (this_nh->nh_dev != dev || fi == prev_fi)
continue;
prev_fi = fi;
dead = 0;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-05 0:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-05 0:36 [PATCH] net/ipv4/fib_semantics.c: fix "symbol shadows an earlier one" noise H Hartley Sweeten
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox