netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 8/9] net/inetdevice: bad_mask can be boolean
Date: Thu,  8 Oct 2015 21:29:01 +0800	[thread overview]
Message-ID: <1444310942-4428-9-git-send-email-bywxiaobai@163.com> (raw)
In-Reply-To: <1444310942-4428-1-git-send-email-bywxiaobai@163.com>

This patch makes bad_mask return bool 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/inetdevice.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 3b0999e..ee971f3 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -180,15 +180,15 @@ static __inline__ bool inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
  *	Check if a mask is acceptable.
  */
  
-static __inline__ int bad_mask(__be32 mask, __be32 addr)
+static __inline__ bool bad_mask(__be32 mask, __be32 addr)
 {
 	__u32 hmask;
 	if (addr & (mask = ~mask))
-		return 1;
+		return true;
 	hmask = ntohl(mask);
 	if (hmask & (hmask+1))
-		return 1;
-	return 0;
+		return true;
+	return false;
 }
 
 #define for_primary_ifa(in_dev)	{ struct in_ifaddr *ifa; \
-- 
1.9.1

  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 ` Yaowei Bai [this message]
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-9-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).