Skip to contentSkip to conversation

net/ipv4/fib_semantics.c: fix "symbol shadows an earlier one" noise

PATCH New H Hartley Sweeten 1 participant 1 message Aug 5, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ipv4/fib_semantics.c: fix "symbol shadows an earlier one" noise

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

---

net/ipv4/fib_semantics.c +4 -4
index 9b096d6..b0e485a 100644
@@ -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;