summaryrefslogtreecommitdiff
path: root/include/linux/inetdevice.h
diff options
context:
space:
mode:
authorYaowei Bai <bywxiaobai@163.com>2015-10-08 16:29:01 +0300
committerDavid S. Miller <davem@davemloft.net>2015-10-09 17:49:05 +0300
commitf06cc7b284f3dfb2c5decbf9fde711b50a530050 (patch)
treeaba136a28deafd4b74df4794eea4dc4da4554157 /include/linux/inetdevice.h
parentc3225164cf60ccecce2459dcb5813dd798233f2d (diff)
downloadlinux-f06cc7b284f3dfb2c5decbf9fde711b50a530050.tar.xz
net/inetdevice: bad_mask can be boolean
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/inetdevice.h')
-rw-r--r--include/linux/inetdevice.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 3b0999e0260f..ee971f335a8b 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; \