Skip to content

Commit 875e082

Browse files
baihuahuadavem330
authored andcommitted
net/nfnetlink: lockdep_nfnl_is_held can be boolean
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>
1 parent 35498ed commit 875e082

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎include/linux/netfilter/nfnetlink.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
4545
void nfnl_lock(__u8 subsys_id);
4646
void nfnl_unlock(__u8 subsys_id);
4747
#ifdef CONFIG_PROVE_LOCKING
48-
int lockdep_nfnl_is_held(__u8 subsys_id);
48+
bool lockdep_nfnl_is_held(__u8 subsys_id);
4949
#else
50-
static inline int lockdep_nfnl_is_held(__u8 subsys_id)
50+
static inline bool lockdep_nfnl_is_held(__u8 subsys_id)
5151
{
52-
return 1;
52+
return true;
5353
}
5454
#endif /* CONFIG_PROVE_LOCKING */
5555

‎net/netfilter/nfnetlink.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void nfnl_unlock(__u8 subsys_id)
6464
EXPORT_SYMBOL_GPL(nfnl_unlock);
6565

6666
#ifdef CONFIG_PROVE_LOCKING
67-
int lockdep_nfnl_is_held(u8 subsys_id)
67+
bool lockdep_nfnl_is_held(u8 subsys_id)
6868
{
6969
return lockdep_is_held(&table[subsys_id].mutex);
7070
}

0 commit comments

Comments
 (0)