From: Duan Jiong <duanj.fnst@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>
Subject: [PATCH net-next] ipv6: remove useless spin_lock/spin_unlock
Date: Wed, 3 Dec 2014 09:32:34 +0800 [thread overview]
Message-ID: <547E6832.4070403@cn.fujitsu.com> (raw)
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
next reply other threads:[~2014-12-03 1:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-03 1:32 Duan Jiong [this message]
2014-12-03 1:57 ` [PATCH net-next] ipv6: remove useless spin_lock/spin_unlock 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547E6832.4070403@cn.fujitsu.com \
--to=duanj.fnst@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.