Skip to content

Commit

Permalink
net/nfnetlink: lockdep_nfnl_is_held can be boolean
Browse files Browse the repository at this point in the history
This patch makes lockdep_nfnl_is_held return bool to improve
readability due to this particular function only using either
one or zero as its return value.

No functional change.

Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yaowei Bai authored and David S. Miller committed Oct 9, 2015
1 parent 35498ed commit 875e082
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/linux/netfilter/nfnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
void nfnl_lock(__u8 subsys_id);
void nfnl_unlock(__u8 subsys_id);
#ifdef CONFIG_PROVE_LOCKING
int lockdep_nfnl_is_held(__u8 subsys_id);
bool lockdep_nfnl_is_held(__u8 subsys_id);
#else
static inline int lockdep_nfnl_is_held(__u8 subsys_id)
static inline bool lockdep_nfnl_is_held(__u8 subsys_id)
{
return 1;
return true;
}
#endif /* CONFIG_PROVE_LOCKING */

Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/nfnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void nfnl_unlock(__u8 subsys_id)
EXPORT_SYMBOL_GPL(nfnl_unlock);

#ifdef CONFIG_PROVE_LOCKING
int lockdep_nfnl_is_held(u8 subsys_id)
bool lockdep_nfnl_is_held(u8 subsys_id)
{
return lockdep_is_held(&table[subsys_id].mutex);
}
Expand Down

0 comments on commit 875e082

Please sign in to comment.