From: Moon Yeounsu <yyyynoom@gmail.com>
To: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Moon Yeounsu <yyyynoom@gmail.com>
Subject: [PATCH net] net: add inline annotation to fix the build warning
Date: Thu, 19 Sep 2024 23:21:49 +0900 [thread overview]
Message-ID: <20240919142149.282175-1-yyyynoom@gmail.com> (raw)
This patch fixes two sparse warnings (`make C=1`):
net/ipv6/icmp.c:103:20: warning: context imbalance in 'icmpv6_xmit_lock' - wrong count at exit
net/ipv6/icmp.c:119:13: warning: context imbalance in 'icmpv6_xmit_unlock' - unexpected unlock
Since `icmp6_xmit_lock()` and `icmp6_xmit_unlock()` are designed as they
are named, entering/returning the function without lock/unlock doesn't
matter.
Signed-off-by: Moon Yeounsu <yyyynoom@gmail.com>
---
net/ipv6/icmp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 071b0bc1179d..d8cc3d63c942 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -101,6 +101,7 @@ static const struct inet6_protocol icmpv6_protocol = {
/* Called with BH disabled */
static struct sock *icmpv6_xmit_lock(struct net *net)
+ __acquires(&sk->sk_lock.slock)
{
struct sock *sk;
@@ -117,6 +118,7 @@ static struct sock *icmpv6_xmit_lock(struct net *net)
}
static void icmpv6_xmit_unlock(struct sock *sk)
+ __releases(&sk->sk_lock.slock)
{
sock_net_set(sk, &init_net);
spin_unlock(&sk->sk_lock.slock);
--
2.46.1
next reply other threads:[~2024-09-19 14:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 14:21 Moon Yeounsu [this message]
2024-09-19 14:56 ` [PATCH net] net: add inline annotation to fix the build warning Simon Horman
2024-09-20 7:27 ` Moon Yeounsu
-- strict thread matches above, loose matches on Subject: below --
2024-10-01 19:33 Moon Yeounsu
[not found] ` <CAAjsZQx1NFdx8HyBmDqDxQbUvcxbaag5y-ft+feWLgQeb1Qfdw@mail.gmail.com>
2024-10-02 14:41 ` Eric Dumazet
2024-10-03 13:56 ` Moon Yeounsu
2024-10-03 14:19 ` Eric Dumazet
2024-10-03 15:33 ` Moon Yeounsu
2024-10-03 16:11 ` Edward Cree
2024-10-03 18:39 ` Stephen Hemminger
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=20240919142149.282175-1-yyyynoom@gmail.com \
--to=yyyynoom@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 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).