Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: netdev@vger.kernel.org
Cc: kuba@kernel.org, davem@davemloft.net, roopa@nvidia.com,
Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
Stephen Rothwell <sfr@canb.auug.org.au>
Subject: [PATCH net-next] net: bridge: mcast: fix unused br var when lockdep isn't defined
Date: Tue, 8 Sep 2020 10:17:13 +0300 [thread overview]
Message-ID: <20200908071713.916165-1-nikolay@cumulusnetworks.com> (raw)
In-Reply-To: <20200908130000.7d33d787@canb.auug.org.au>
Stephen reported the following warning:
net/bridge/br_multicast.c: In function 'br_multicast_find_port':
net/bridge/br_multicast.c:1818:21: warning: unused variable 'br' [-Wunused-variable]
1818 | struct net_bridge *br = mp->br;
| ^~
It happens due to bridge's mlock_dereference() when lockdep isn't defined.
Silence the warning by annotating the variable as __maybe_unused.
Fixes: 0436862e417e ("net: bridge: mcast: support for IGMPv3/MLDv2 ALLOW_NEW_SOURCES report")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
---
net/bridge/br_multicast.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index b83f11228948..33adf44ef7ec 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1814,8 +1814,8 @@ br_multicast_find_port(struct net_bridge_mdb_entry *mp,
struct net_bridge_port *p,
const unsigned char *src)
{
+ struct net_bridge *br __maybe_unused = mp->br;
struct net_bridge_port_group *pg;
- struct net_bridge *br = mp->br;
for (pg = mlock_dereference(mp->ports, br);
pg;
--
2.25.4
next prev parent reply other threads:[~2020-09-08 7:17 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-08 3:00 linux-next: build warning after merge of the net-next tree Stephen Rothwell
2020-09-08 3:49 ` Jakub Kicinski
2020-09-08 7:17 ` Nikolay Aleksandrov [this message]
2020-09-08 16:00 ` [PATCH net-next] net: bridge: mcast: fix unused br var when lockdep isn't defined Jakub Kicinski
2020-09-08 16:09 ` nikolay
2020-09-08 17:36 ` [PATCH net-next] rcu: prevent RCU_LOCKDEP_WARN() from swallowing the condition Jakub Kicinski
2020-09-08 18:15 ` nikolay
2020-09-09 0:27 ` Jakub Kicinski
2020-09-14 20:21 ` Joel Fernandes
2020-09-14 22:47 ` Jakub Kicinski
2020-09-15 0:20 ` Paul E. McKenney
2020-09-15 0:30 ` Jakub Kicinski
2020-09-15 17:02 ` Paul E. McKenney
2020-09-15 1:34 ` Joel Fernandes
2020-09-09 3:12 ` 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=20200908071713.916165-1-nikolay@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=roopa@nvidia.com \
--cc=sfr@canb.auug.org.au \
--subject='Re: [PATCH net-next] net: bridge: mcast: fix unused br var when lockdep isn'\''t defined' \
/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
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).