From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
James Morris <jmorris@namei.org>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Patrick McHardy <kaber@trash.net>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] igmp: fix build warning
Date: Tue, 16 Feb 2016 13:52:30 +0530 [thread overview]
Message-ID: <1455610950-27802-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
We were getting build warnings about:
net/ipv4/igmp.c: In function ‘igmp_group_added’:
net/ipv4/igmp.c:1227:14: warning: unused variable ‘net’ [-Wunused-variable]
net/ipv4/igmp.c: In function ‘ip_mc_inc_group’:
net/ipv4/igmp.c:1319:14: warning: unused variable ‘net’ [-Wunused-variable]
net/ipv4/igmp.c: In function ‘ip_mc_init_dev’:
net/ipv4/igmp.c:1646:14: warning: unused variable ‘net’ [-Wunused-variable]
net/ipv4/igmp.c: In function ‘ip_mc_up’:
net/ipv4/igmp.c:1665:14: warning: unused variable ‘net’ [-Wunused-variable]
These variables are only used when CONFIG_IP_MULTICAST is defined. Mark
them as '__maybe_unused'.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
net/ipv4/igmp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 7c95335..0ba241b 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1224,7 +1224,7 @@ static void igmp_group_dropped(struct ip_mc_list *im)
static void igmp_group_added(struct ip_mc_list *im)
{
struct in_device *in_dev = im->interface;
- struct net *net = dev_net(in_dev->dev);
+ struct net __maybe_unused *net = dev_net(in_dev->dev);
if (im->loaded == 0) {
im->loaded = 1;
@@ -1316,7 +1316,7 @@ static void ip_mc_hash_remove(struct in_device *in_dev,
void ip_mc_inc_group(struct in_device *in_dev, __be32 addr)
{
struct ip_mc_list *im;
- struct net *net = dev_net(in_dev->dev);
+ struct net __maybe_unused *net = dev_net(in_dev->dev);
ASSERT_RTNL();
@@ -1643,7 +1643,7 @@ void ip_mc_down(struct in_device *in_dev)
void ip_mc_init_dev(struct in_device *in_dev)
{
- struct net *net = dev_net(in_dev->dev);
+ struct net __maybe_unused *net = dev_net(in_dev->dev);
ASSERT_RTNL();
#ifdef CONFIG_IP_MULTICAST
@@ -1662,7 +1662,7 @@ void ip_mc_init_dev(struct in_device *in_dev)
void ip_mc_up(struct in_device *in_dev)
{
struct ip_mc_list *pmc;
- struct net *net = dev_net(in_dev->dev);
+ struct net __maybe_unused *net = dev_net(in_dev->dev);
ASSERT_RTNL();
--
1.9.1
reply other threads:[~2016-02-16 8:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1455610950-27802-1-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.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).