Skip to content

Commit 9df9e78

Browse files
pebolleummakynes
authored andcommitted
netfilter: nfnetlink: silence warning if CONFIG_PROVE_RCU isn't set
Since commit c14b78e ("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: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent ed018fa commit 9df9e78

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

net/netfilter/nfnetlink.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ void nfnl_unlock(__u8 subsys_id)
6262
}
6363
EXPORT_SYMBOL_GPL(nfnl_unlock);
6464

65-
static struct mutex *nfnl_get_lock(__u8 subsys_id)
66-
{
67-
return &table[subsys_id].mutex;
68-
}
69-
7065
int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n)
7166
{
7267
nfnl_lock(n->subsys_id);
@@ -199,7 +194,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
199194
rcu_read_unlock();
200195
nfnl_lock(subsys_id);
201196
if (rcu_dereference_protected(table[subsys_id].subsys,
202-
lockdep_is_held(nfnl_get_lock(subsys_id))) != ss ||
197+
lockdep_is_held(&table[subsys_id].mutex)) != ss ||
203198
nfnetlink_find_client(type, ss) != nc)
204199
err = -EAGAIN;
205200
else if (nc->call)

0 commit comments

Comments
 (0)