* [PATCH net] net: fix sparse warning in sk_dst_set()
@ 2014-07-02 9:39 Eric Dumazet
2014-07-03 0:03 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2014-07-02 9:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev
From: Eric Dumazet <edumazet@google.com>
sk_dst_cache has __rcu annotation, so we need a cast to avoid
following sparse error :
include/net/sock.h:1774:19: warning: incorrect type in initializer (different address spaces)
include/net/sock.h:1774:19: expected struct dst_entry [noderef] <asn:4>*__ret
include/net/sock.h:1774:19: got struct dst_entry *dst
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Fixes: 7f502361531e ("ipv4: irq safe sk_dst_[re]set() and ipv4_sk_update_pmtu() fix")
---
include/net/sock.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/sock.h b/include/net/sock.h
index c556fd9b05ac..156350745700 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1771,7 +1771,7 @@ sk_dst_set(struct sock *sk, struct dst_entry *dst)
struct dst_entry *old_dst;
sk_tx_queue_clear(sk);
- old_dst = xchg(&sk->sk_dst_cache, dst);
+ old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst);
dst_release(old_dst);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] net: fix sparse warning in sk_dst_set()
2014-07-02 9:39 [PATCH net] net: fix sparse warning in sk_dst_set() Eric Dumazet
@ 2014-07-03 0:03 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-07-03 0:03 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Wed, 02 Jul 2014 02:39:38 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> sk_dst_cache has __rcu annotation, so we need a cast to avoid
> following sparse error :
>
> include/net/sock.h:1774:19: warning: incorrect type in initializer (different address spaces)
> include/net/sock.h:1774:19: expected struct dst_entry [noderef] <asn:4>*__ret
> include/net/sock.h:1774:19: got struct dst_entry *dst
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Fixes: 7f502361531e ("ipv4: irq safe sk_dst_[re]set() and ipv4_sk_update_pmtu() fix")
Applied and I'll make sure this gets passed along with I send 7f502361531e to -stable.
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-03 0:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-02 9:39 [PATCH net] net: fix sparse warning in sk_dst_set() Eric Dumazet
2014-07-03 0:03 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).