[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <201001141652.42757.hartleys@visionengravers.com>
Date: Thu, 14 Jan 2010 16:52:41 -0700
From: H Hartley Sweeten <hartleys@...ionengravers.com>
To: Linux Kernel <linux-kernel@...r.kernel.org>, netdev@...r.kernel.org
Cc: davem@...emloft.net, kuznet@....inr.ac.ru, pekkas@...core.fi,
jmorris@...ei.org, yoshfuji@...ux-ipv6.org, kaber@...sh.net
Subject: [PATCH] net/ipv4/fib_semantics.c: quiet sparse "shadows" noise
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@...ionengravers.com>
Cc: David S. Miller <davem@...emloft.net>
Cc: Alexey Kuznetsov <kuznet@....inr.ac.ru>
Cc: "Pekka Savola (ipv6)" <pekkas@...core.fi>
Cc: James Morris <jmorris@...ei.org>
Cc: Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>
Cc: Patrick McHardy <kaber@...sh.net>
---
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index ed19aa6..cec97f0 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;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists