netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock
@ 2013-03-04 19:43 Alexandru Gheorghiu
  2013-03-04 21:05 ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Alexandru Gheorghiu @ 2013-03-04 19:43 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Patrick McHardy, David S. Miller
  Cc: netdev, linux-kernel, Alexandru Gheorghiu

Removed unused function nfnl_get_lock which fixed the following warning:
net/netfilter/nfnetlink.c:65:22: warning: ‘nfnl_get_lock’ defined but not used [-Wunused-function]

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
---
 net/netfilter/nfnetlink.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index d578ec2..44aa0a7 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -62,11 +62,6 @@ void nfnl_unlock(__u8 subsys_id)
 }
 EXPORT_SYMBOL_GPL(nfnl_unlock);

-static struct mutex *nfnl_get_lock(__u8 subsys_id)
-{
-	return &table[subsys_id].mutex;
-}
-
 int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n)
 {
 	nfnl_lock(n->subsys_id);
--
1.7.9.5

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock
  2013-03-04 19:43 [PATCH] net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock Alexandru Gheorghiu
@ 2013-03-04 21:05 ` Borislav Petkov
  2013-03-04 21:23   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 4+ messages in thread
From: Borislav Petkov @ 2013-03-04 21:05 UTC (permalink / raw)
  To: Alexandru Gheorghiu
  Cc: Pablo Neira Ayuso, Patrick McHardy, David S. Miller, netdev,
	linux-kernel

On Mon, Mar 04, 2013 at 09:43:11PM +0200, Alexandru Gheorghiu wrote:
> Removed unused function nfnl_get_lock which fixed the following warning:
> net/netfilter/nfnetlink.c:65:22: warning: ‘nfnl_get_lock’ defined but not used [-Wunused-function]
> 
> Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
> ---
>  net/netfilter/nfnetlink.c |    5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
> index d578ec2..44aa0a7 100644
> --- a/net/netfilter/nfnetlink.c
> +++ b/net/netfilter/nfnetlink.c
> @@ -62,11 +62,6 @@ void nfnl_unlock(__u8 subsys_id)
>  }
>  EXPORT_SYMBOL_GPL(nfnl_unlock);
> 
> -static struct mutex *nfnl_get_lock(__u8 subsys_id)
> -{
> -	return &table[subsys_id].mutex;
> -}
> -

I see the same warning here, gcc (Debian 4.7.2-5) 4.7.2.

Actually this function *is* used a bit further in the same file in
nfnetlink_rcv_msg().

But gcc complains for some reason of which I don't even have the
slightest idea. However, if you declare the above function "static
inline..." the warning is gone.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock
  2013-03-04 21:05 ` Borislav Petkov
@ 2013-03-04 21:23   ` Pablo Neira Ayuso
  2013-03-04 21:42     ` Borislav Petkov
  0 siblings, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2013-03-04 21:23 UTC (permalink / raw)
  To: Borislav Petkov, Alexandru Gheorghiu, Patrick McHardy,
	David S. Miller, netdev, linux-kernel

On Mon, Mar 04, 2013 at 10:05:51PM +0100, Borislav Petkov wrote:
> On Mon, Mar 04, 2013 at 09:43:11PM +0200, Alexandru Gheorghiu wrote:
> > Removed unused function nfnl_get_lock which fixed the following warning:
> > net/netfilter/nfnetlink.c:65:22: warning: ‘nfnl_get_lock’ defined but not used [-Wunused-function]
> > 
> > Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
> > ---
> >  net/netfilter/nfnetlink.c |    5 -----
> >  1 file changed, 5 deletions(-)
> > 
> > diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
> > index d578ec2..44aa0a7 100644
> > --- a/net/netfilter/nfnetlink.c
> > +++ b/net/netfilter/nfnetlink.c
> > @@ -62,11 +62,6 @@ void nfnl_unlock(__u8 subsys_id)
> >  }
> >  EXPORT_SYMBOL_GPL(nfnl_unlock);
> > 
> > -static struct mutex *nfnl_get_lock(__u8 subsys_id)
> > -{
> > -	return &table[subsys_id].mutex;
> > -}
> > -
> 
> I see the same warning here, gcc (Debian 4.7.2-5) 4.7.2.
> 
> Actually this function *is* used a bit further in the same file in
> nfnetlink_rcv_msg().
> 
> But gcc complains for some reason of which I don't even have the
> slightest idea. However, if you declare the above function "static
> inline..." the warning is gone.

Already got a fix for compilation warning in my tree:

http://1984.lsi.us.es/git/nf/commit/?id=9df9e7832391cf699abbf39fc8d95d7e78297462

Thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock
  2013-03-04 21:23   ` Pablo Neira Ayuso
@ 2013-03-04 21:42     ` Borislav Petkov
  0 siblings, 0 replies; 4+ messages in thread
From: Borislav Petkov @ 2013-03-04 21:42 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Alexandru Gheorghiu, Patrick McHardy, David S. Miller, netdev,
	linux-kernel

On Mon, Mar 04, 2013 at 10:23:38PM +0100, Pablo Neira Ayuso wrote:
> Already got a fix for compilation warning in my tree:
> 
> http://1984.lsi.us.es/git/nf/commit/?id=9df9e7832391cf699abbf39fc8d95d7e78297462

And it even explains why gcc complains.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-04 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-04 19:43 [PATCH] net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock Alexandru Gheorghiu
2013-03-04 21:05 ` Borislav Petkov
2013-03-04 21:23   ` Pablo Neira Ayuso
2013-03-04 21:42     ` Borislav Petkov

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).