diff mbox

net: netfilter: nfnetlink: Fixed warning for nfnl_get_lock

Message ID 1362426192-2921-1-git-send-email-gheorghiuandru@gmail.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Alexandru Gheorghiu March 4, 2013, 7:43 p.m. UTC
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(-)

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

Comments

Borislav Petkov March 4, 2013, 9:05 p.m. UTC | #1
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.
Pablo Neira Ayuso March 4, 2013, 9:23 p.m. UTC | #2
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!
--
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
Borislav Petkov March 4, 2013, 9:42 p.m. UTC | #3
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.
diff mbox

Patch

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