From: Yaowei Bai <bywxiaobai@163.com>
To: davem@davemloft.net, tgraf@suug.ch, herbert@gondor.apana.org.au,
johannes.berg@intel.com, daniel@iogearbox.net,
gerrit@erg.abdn.ac.uk, socketcan@hartkopp.net,
mkl@pengutronix.de
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 9/9] net/core: lockdep_rtnl_is_held can be boolean
Date: Thu, 8 Oct 2015 21:29:02 +0800 [thread overview]
Message-ID: <1444310942-4428-10-git-send-email-bywxiaobai@163.com> (raw)
In-Reply-To: <1444310942-4428-1-git-send-email-bywxiaobai@163.com>
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 <bywxiaobai@163.com>
---
include/linux/rtnetlink.h | 6 +++---
net/core/rtnetlink.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 39adaa9..4be5048 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -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 */
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 0ec4840..435da82 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -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);
}
--
1.9.1
next prev parent reply other threads:[~2015-10-08 13:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-08 13:28 [PATCH 0/9] net: small improvement Yaowei Bai
2015-10-08 13:28 ` [PATCH 1/9] net/netlink: lockdep_genl_is_held can be boolean Yaowei Bai
2015-10-08 13:28 ` [PATCH 2/9] net/ieee80211: ieee80211_is_* " Yaowei Bai
2015-10-08 13:28 ` [PATCH 3/9] net/nfnetlink: lockdep_nfnl_is_held " Yaowei Bai
2015-10-08 13:28 ` [PATCH 4/9] net/can: can_dropped_invalid_skb " Yaowei Bai
2015-10-09 10:14 ` Marc Kleine-Budde
2015-10-09 14:25 ` Yaowei Bai
2015-10-12 9:00 ` Marc Kleine-Budde
2015-10-08 13:28 ` [PATCH 5/9] net/dccp: dccp_list_has_service " Yaowei Bai
2015-10-08 13:28 ` [PATCH 6/9] net/dccp: dccp_bad_service_code " Yaowei Bai
2015-10-08 13:29 ` [PATCH 7/9] net/inetdevice: inet_ifa_match " Yaowei Bai
2015-10-08 13:29 ` [PATCH 8/9] net/inetdevice: bad_mask " Yaowei Bai
2015-10-08 13:29 ` Yaowei Bai [this message]
2015-10-09 14:49 ` [PATCH 0/9] net: small improvement David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444310942-4428-10-git-send-email-bywxiaobai@163.com \
--to=bywxiaobai@163.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=gerrit@erg.abdn.ac.uk \
--cc=herbert@gondor.apana.org.au \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
--cc=tgraf@suug.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).