Thread (1 message) 1 message, 1 author, 2008-01-23

[IPV4 5/5] fib_semantics: sparse warnings

From: Stephen Hemminger <hidden>
Date: 2008-01-23 23:00:48

The magic macro change_nexthops introduces a variable nh which overlaps
previous declaration of nh.

Signed-off-by: Stephen Hemminger <redacted>

--- a/net/ipv4/fib_semantics.c	2008-01-23 11:03:55.000000000 -0800
+++ b/net/ipv4/fib_semantics.c	2008-01-23 11:05:12.000000000 -0800
@@ -1059,14 +1059,14 @@ int fib_sync_down(__be32 local, struct n
 		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 *nh1;
 
-		hlist_for_each_entry(nh, node, head, nh_hash) {
-			struct fib_info *fi = nh->nh_parent;
+		hlist_for_each_entry(nh1, node, head, nh_hash) {
+			struct fib_info *fi = nh1->nh_parent;
 			int dead;
 
 			BUG_ON(!fi->fib_nhs);
-			if (nh->nh_dev != dev || fi == prev_fi)
+			if (nh1->nh_dev != dev || fi == prev_fi)
 				continue;
 			prev_fi = fi;
 			dead = 0;
@@ -1091,6 +1091,7 @@ int fib_sync_down(__be32 local, struct n
 				}
 #endif
 			} endfor_nexthops(fi)
+
 			if (dead == fi->fib_nhs) {
 				fi->fib_flags |= RTNH_F_DEAD;
 				ret++;
@@ -1114,7 +1115,7 @@ int fib_sync_up(struct net_device *dev)
 	unsigned int hash;
 	struct hlist_head *head;
 	struct hlist_node *node;
-	struct fib_nh *nh;
+	struct fib_nh *nh1;
 	int ret;
 
 	if (!(dev->flags&IFF_UP))
@@ -1125,12 +1126,12 @@ int fib_sync_up(struct net_device *dev)
 	head = &fib_info_devhash[hash];
 	ret = 0;
 
-	hlist_for_each_entry(nh, node, head, nh_hash) {
-		struct fib_info *fi = nh->nh_parent;
+	hlist_for_each_entry(nh1, node, head, nh_hash) {
+		struct fib_info *fi = nh1->nh_parent;
 		int alive;
 
 		BUG_ON(!fi->fib_nhs);
-		if (nh->nh_dev != dev || fi == prev_fi)
+		if (nh1->nh_dev != dev || fi == prev_fi)
 			continue;
 
 		prev_fi = fi;
-- 
Stephen Hemminger <stephen.hemminger@vyatta.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help