]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
net: bridge: mcast: fix unused br var when lockdep isn't defined
authorNikolay Aleksandrov <nikolay@cumulusnetworks.com>
Tue, 8 Sep 2020 07:17:13 +0000 (10:17 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Sep 2020 03:11:57 +0000 (20:11 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c

index b83f11228948dda1caba8c6de6f2686e47008814..33adf44ef7ecb376b2f796aa1bff27c9251c6c6e 100644 (file)
@@ -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;