[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240919142149.282175-1-yyyynoom@gmail.com>
Date: Thu, 19 Sep 2024 23:21:49 +0900
From: Moon Yeounsu <yyyynoom@...il.com>
To: davem@...emloft.net,
dsahern@...nel.org,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.org
Cc: netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Moon Yeounsu <yyyynoom@...il.com>
Subject: [PATCH net] net: add inline annotation to fix the build warning
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@...il.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
Powered by blists - more mailing lists