* [PATCH] net: core: fix unused variable sparse warning
@ 2012-12-07 0:06 Cong Ding
2012-12-07 0:15 ` Cong Ding
2012-12-07 2:26 ` Cong Wang
0 siblings, 2 replies; 5+ messages in thread
From: Cong Ding @ 2012-12-07 0:06 UTC (permalink / raw)
To: David S. Miller, Eric W. Biederman, Eric Dumazet, Pavel Emelyanov,
netdev, linux-kernel
Cc: Cong Ding
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: fix unused variable sparse warning
2012-12-07 0:06 [PATCH] net: core: fix unused variable sparse warning Cong Ding
@ 2012-12-07 0:15 ` Cong Ding
2012-12-07 3:25 ` David Miller
2012-12-07 10:45 ` Shan Wei
2012-12-07 2:26 ` Cong Wang
1 sibling, 2 replies; 5+ messages in thread
From: Cong Ding @ 2012-12-07 0:15 UTC (permalink / raw)
To: David S. Miller, Eric W. Biederman, Eric Dumazet, Pavel Emelyanov,
netdev, linux-kernel
On Fri, Dec 07, 2012 at 12:06:44AM +0000, Cong Ding wrote:
> 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.
sorry for disturbing again, the sparse warning is
net/core/neighbour.c:65:12: warning: ‘zero’ defined but not used [-Wunused-variable]
net/core/neighbour.c:66:12: warning: ‘unres_qlen_max’ defined but not used [-Wunused-variable]
it happens if we turn off 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: fix unused variable sparse warning
2012-12-07 0:06 [PATCH] net: core: fix unused variable sparse warning Cong Ding
2012-12-07 0:15 ` Cong Ding
@ 2012-12-07 2:26 ` Cong Wang
1 sibling, 0 replies; 5+ messages in thread
From: Cong Wang @ 2012-12-07 2:26 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev
On Fri, 07 Dec 2012 at 00:06 GMT, Cong Ding <dinggnu@gmail.com> wrote:
> 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.
>
commit b93196dc5af7729ff7cc50d3d322ab1a364aa14f
Author: Cong Wang <amwang@redhat.com>
Date: Thu Dec 6 10:04:04 2012 +0800
net: fix some compiler warning in net/core/neighbour.c
net/core/neighbour.c:65:12: warning: 'zero' defined but
not used [-Wunused-variable]
net/core/neighbour.c:66:12: warning: 'unres_qlen_max' defined but
not used [-Wunused-variable]
These variables are only used when CONFIG_SYSCTL is defined,
so move them under #ifdef CONFIG_SYSCTL.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Acked-by: Shan Wei <davidshan@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: fix unused variable sparse warning
2012-12-07 0:15 ` Cong Ding
@ 2012-12-07 3:25 ` David Miller
2012-12-07 10:45 ` Shan Wei
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2012-12-07 3:25 UTC (permalink / raw)
To: dinggnu; +Cc: ebiederm, edumazet, xemul, netdev, linux-kernel
From: Cong Ding <dinggnu@gmail.com>
Date: Fri, 7 Dec 2012 00:15:47 +0000
> On Fri, Dec 07, 2012 at 12:06:44AM +0000, Cong Ding wrote:
>> 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.
> sorry for disturbing again, the sparse warning is
> net/core/neighbour.c:65:12: warning: ‘zero’ defined but not used [-Wunused-variable]
> net/core/neighbour.c:66:12: warning: ‘unres_qlen_max’ defined but not used [-Wunused-variable]
>
> it happens if we turn off CONFIG_SYSCTL.
A patch for this has already in my tree for nearly a whole day.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] net: core: fix unused variable sparse warning
2012-12-07 0:15 ` Cong Ding
2012-12-07 3:25 ` David Miller
@ 2012-12-07 10:45 ` Shan Wei
1 sibling, 0 replies; 5+ messages in thread
From: Shan Wei @ 2012-12-07 10:45 UTC (permalink / raw)
To: Cong Ding
Cc: David S. Miller, Eric W. Biederman, Eric Dumazet, Pavel Emelyanov,
netdev, linux-kernel
Cong Ding said, at 2012/12/7 8:15:
> On Fri, Dec 07, 2012 at 12:06:44AM +0000, Cong Ding wrote:
>> 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.
> sorry for disturbing again, the sparse warning is
> net/core/neighbour.c:65:12: warning: ‘zero’ defined but not used [-Wunused-variable]
> net/core/neighbour.c:66:12: warning: ‘unres_qlen_max’ defined but not used [-Wunused-variable]
>
> it happens if we turn off CONFIG_SYSCTL.
It has been fixed yesterday.
see b93196dc5af7729ff7cc50d3d322ab1a364aa14f
>
>>
>> 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
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-12-07 10:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-07 0:06 [PATCH] net: core: fix unused variable sparse warning Cong Ding
2012-12-07 0:15 ` Cong Ding
2012-12-07 3:25 ` David Miller
2012-12-07 10:45 ` Shan Wei
2012-12-07 2:26 ` Cong Wang
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).