netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Ding <dinggnu@gmail.com>
To: "David S. Miller" <davem@davemloft.net>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Eric Dumazet <edumazet@google.com>,
	Pavel Emelyanov <xemul@parallels.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Cong Ding <dinggnu@gmail.com>
Subject: [PATCH] net: core: fix unused variable sparse warning
Date: Fri,  7 Dec 2012 00:06:44 +0000	[thread overview]
Message-ID: <1354838913-20084-1-git-send-email-dinggnu@gmail.com> (raw)

the variables zero and unres_qlen_max are only used when CONFIG_SYSCTL is
defined, otherwise it causes the following sparse warning when we turn on
CONFIG_SYSCTL.

Signed-off-by: Cong Ding <dinggnu@gmail.com>
---
 net/core/neighbour.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 36fc692..4a15278 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -62,8 +62,10 @@ static void __neigh_notify(struct neighbour *n, int type, int flags);
 static void neigh_update_notify(struct neighbour *neigh);
 static int pneigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
 
+#ifdef CONFIG_SYSCTL
 static int zero;
 static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN);
+#endif
 
 static struct neigh_table *neigh_tables;
 #ifdef CONFIG_PROC_FS
-- 
1.7.4.5

             reply	other threads:[~2012-12-07  0:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  0:06 Cong Ding [this message]
2012-12-07  0:15 ` [PATCH] net: core: fix unused variable sparse warning Cong Ding
2012-12-07  3:25   ` David Miller
2012-12-07 10:45   ` Shan Wei
2012-12-07  2:26 ` Cong Wang

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=1354838913-20084-1-git-send-email-dinggnu@gmail.com \
    --to=dinggnu@gmail.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xemul@parallels.com \
    /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).