netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ipv6: remove useless spin_lock/spin_unlock
@ 2014-12-03  1:32 Duan Jiong
  2014-12-03  1:57 ` Eric Dumazet
  2014-12-03  2:29 ` [PATCH net-next v2] " Duan Jiong
  0 siblings, 2 replies; 6+ messages in thread
From: Duan Jiong @ 2014-12-03  1:32 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


xchg is atomic, so there is no necessary to use spin_lock/spin_unlock
to protect it.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 net/ipv6/ipv6_sockglue.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index e1a9583..92ca907 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -112,9 +112,7 @@ struct ipv6_txoptions *ipv6_update_options(struct sock *sk,
 		}
 		opt = xchg(&inet6_sk(sk)->opt, opt);
 	} else {
-		spin_lock(&sk->sk_dst_lock);
 		opt = xchg(&inet6_sk(sk)->opt, opt);
-		spin_unlock(&sk->sk_dst_lock);
 	}
 	sk_dst_reset(sk);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-09 18:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03  1:32 [PATCH net-next] ipv6: remove useless spin_lock/spin_unlock Duan Jiong
2014-12-03  1:57 ` Eric Dumazet
2014-12-03  2:05   ` Duan Jiong
2014-12-03  2:29 ` [PATCH net-next v2] " Duan Jiong
2014-12-03  5:18   ` Joe Perches
2014-12-09 18:18   ` 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).