[PATCH net] net: ipv4: fix sparse error in fib_good_nh()

Subsystems: networking [general], networking [ipv4/ipv6], the rest

STALE3653d

3 messages, 3 authors, 2016-08-20 · open the first message on its own page

[PATCH net] net: ipv4: fix sparse error in fib_good_nh()

From: Eric Dumazet <hidden>
Date: 2016-08-19 03:01:02

From: Eric Dumazet <edumazet@google.com>

Fixes following sparse errors :

net/ipv4/fib_semantics.c:1579:61: warning: incorrect type in argument 2
(different base types)
net/ipv4/fib_semantics.c:1579:61:    expected unsigned int [unsigned]
[usertype] key
net/ipv4/fib_semantics.c:1579:61:    got restricted __be32 const
[usertype] nh_gw


Fixes: a6db4494d218c ("net: ipv4: Consider failed nexthops in multipath routes")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/fib_semantics.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 539fa264e67d..8066ccc48a17 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1576,7 +1576,8 @@ static bool fib_good_nh(const struct fib_nh *nh)
 
 		rcu_read_lock_bh();
 
-		n = __ipv4_neigh_lookup_noref(nh->nh_dev, nh->nh_gw);
+		n = __ipv4_neigh_lookup_noref(nh->nh_dev,
+					      (__force u32)nh->nh_gw);
 		if (n)
 			state = n->nud_state;
 

Re: [PATCH net] net: ipv4: fix sparse error in fib_good_nh()

From: David Ahern <hidden>
Date: 2016-08-19 02:46:14

On 8/18/16 11:19 AM, Eric Dumazet wrote:
From: Eric Dumazet <edumazet@google.com>

Fixes following sparse errors :

net/ipv4/fib_semantics.c:1579:61: warning: incorrect type in argument 2
(different base types)
net/ipv4/fib_semantics.c:1579:61:    expected unsigned int [unsigned]
[usertype] key
net/ipv4/fib_semantics.c:1579:61:    got restricted __be32 const
[usertype] nh_gw


Fixes: a6db4494d218c ("net: ipv4: Consider failed nexthops in multipath routes")
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
 net/ipv4/fib_semantics.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: David Ahern <redacted>

Thanks, Eric.

Re: [PATCH net] net: ipv4: fix sparse error in fib_good_nh()

From: David Miller <davem@davemloft.net>
Date: 2016-08-20 00:08:44

From: Eric Dumazet <redacted>
Date: Thu, 18 Aug 2016 10:19:34 -0700
From: Eric Dumazet <edumazet@google.com>

Fixes following sparse errors :

net/ipv4/fib_semantics.c:1579:61: warning: incorrect type in argument 2
(different base types)
net/ipv4/fib_semantics.c:1579:61:    expected unsigned int [unsigned]
[usertype] key
net/ipv4/fib_semantics.c:1579:61:    got restricted __be32 const
[usertype] nh_gw


Fixes: a6db4494d218c ("net: ipv4: Consider failed nexthops in multipath routes")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help