Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242368

[PATCH 8/9] net/inetdevice: bad_mask can be boolean

From Yaowei Bai <bywxiaobai@163.com>
Newsgroups linux.kernel
Subject [PATCH 8/9] net/inetdevice: bad_mask can be boolean
Date 2015-10-08 15:50 +0200
Message-ID <qhjK2-58q-3@gated-at.bofh.it> (permalink)
References <qhjAl-4X0-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/9] net: small improvement Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
  [PATCH 5/9] net/dccp: dccp_list_has_service can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
  [PATCH 3/9] net/nfnetlink: lockdep_nfnl_is_held can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
  [PATCH 7/9] net/inetdevice: inet_ifa_match can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
  [PATCH 1/9] net/netlink: lockdep_genl_is_held can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
  [PATCH 4/9] net/can: can_dropped_invalid_skb can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
    Re: [PATCH 4/9] net/can: can_dropped_invalid_skb can be boolean Marc Kleine-Budde <mkl@pengutronix.de> - 2015-10-09 12:20 +0200
      Re: [PATCH 4/9] net/can: can_dropped_invalid_skb can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-09 16:30 +0200
        Re: [PATCH 4/9] net/can: can_dropped_invalid_skb can be boolean Marc Kleine-Budde <mkl@pengutronix.de> - 2015-10-12 11:10 +0200
  [PATCH 2/9] net/ieee80211: ieee80211_is_* can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:40 +0200
  [PATCH 6/9] net/dccp: dccp_bad_service_code can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:50 +0200
  [PATCH 8/9] net/inetdevice: bad_mask can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:50 +0200
  [PATCH 9/9] net/core: lockdep_rtnl_is_held can be boolean Yaowei Bai <bywxiaobai@163.com> - 2015-10-08 15:50 +0200
  Re: [PATCH 0/9] net: small improvement David Miller <davem@davemloft.net> - 2015-10-09 16:40 +0200

csiph-web