Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9df9e783 authored by Paul Bolle's avatar Paul Bolle Committed by Pablo Neira Ayuso
Browse files

netfilter: nfnetlink: silence warning if CONFIG_PROVE_RCU isn't set



Since commit c14b78e7 ("netfilter:
nfnetlink: add mutex per subsystem") building nefnetlink.o without
CONFIG_PROVE_RCU set, triggers this GCC warning:
    net/netfilter/nfnetlink.c:65:22: warning: ‘nfnl_get_lock’ defined but not used [-Wunused-function]

The cause of that warning is, in short, that rcu_lockdep_assert()
compiles away if CONFIG_PROVE_RCU is not set. Silence this warning by
open coding nfnl_get_lock() in the sole place it was called, which
allows to remove that function.

Signed-off-by: default avatarPaul Bolle <pebolle@tiscali.nl>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent ed018fa4
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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);
@@ -199,7 +194,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
			rcu_read_unlock();
			nfnl_lock(subsys_id);
			if (rcu_dereference_protected(table[subsys_id].subsys,
				lockdep_is_held(nfnl_get_lock(subsys_id))) != ss ||
				lockdep_is_held(&table[subsys_id].mutex)) != ss ||
			    nfnetlink_find_client(type, ss) != nc)
				err = -EAGAIN;
			else if (nc->call)