Skip to content

Commit

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

In another patch lockdep_is_held is also made return bool.

No functional change.

Signed-off-by: Yaowei Bai <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
baihuahua authored and davem330 committed Oct 9, 2015
1 parent f06cc7b commit 0cbf334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions include/linux/rtnetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ extern wait_queue_head_t netdev_unregistering_wq;
extern struct mutex net_mutex;

#ifdef CONFIG_PROVE_LOCKING
extern int lockdep_rtnl_is_held(void);
extern bool lockdep_rtnl_is_held(void);
#else
static inline int lockdep_rtnl_is_held(void)
static inline bool lockdep_rtnl_is_held(void)
{
return 1;
return true;
}
#endif /* #ifdef CONFIG_PROVE_LOCKING */

Expand Down
2 changes: 1 addition & 1 deletion net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int rtnl_is_locked(void)
EXPORT_SYMBOL(rtnl_is_locked);

#ifdef CONFIG_PROVE_LOCKING
int lockdep_rtnl_is_held(void)
bool lockdep_rtnl_is_held(void)
{
return lockdep_is_held(&rtnl_mutex);
}
Expand Down

0 comments on commit 0cbf334

Please sign in to comment.