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>
This commit is contained in:
parent
c3225164cf
commit
f06cc7b284
|
@ -180,15 +180,15 @@ static __inline__ bool inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
|
||||||
* Check if a mask is acceptable.
|
* 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;
|
__u32 hmask;
|
||||||
if (addr & (mask = ~mask))
|
if (addr & (mask = ~mask))
|
||||||
return 1;
|
return true;
|
||||||
hmask = ntohl(mask);
|
hmask = ntohl(mask);
|
||||||
if (hmask & (hmask+1))
|
if (hmask & (hmask+1))
|
||||||
return 1;
|
return true;
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define for_primary_ifa(in_dev) { struct in_ifaddr *ifa; \
|
#define for_primary_ifa(in_dev) { struct in_ifaddr *ifa; \
|
||||||
|
|
Loading…
Reference in New Issue