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 3/9] net/nfnetlink: lockdep_nfnl_is_held can be boolean
Date: Thu, 8 Oct 2015 21:28:56 +0800 [thread overview]
Message-ID: <1444310942-4428-4-git-send-email-bywxiaobai@163.com> (raw)
In-Reply-To: <1444310942-4428-1-git-send-email-bywxiaobai@163.com>
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>
---
include/linux/netfilter/nfnetlink.h | 6 +++---
net/netfilter/nfnetlink.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index e955d47..249d1bb 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -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 */
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c
index 70277b1..f1d9e88 100644
--- a/net/netfilter/nfnetlink.c
+++ b/net/netfilter/nfnetlink.c
@@ -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);
}
--
1.9.1
next prev parent reply other threads:[~2015-10-08 13:37 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 ` Yaowei Bai [this message]
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 ` [PATCH 9/9] net/core: lockdep_rtnl_is_held " Yaowei Bai
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-4-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).