Commit 4d886d65 authored by David S. Miller's avatar David S. Miller

Merge branch 'net-bool'

Yaowei Bai says:

====================
net: small improvement

This patchset makes several functions in net return bool to improve
readability and/or simplicity because these functions only use one
or zero as their return value.

No functional changes.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 8cec75bd 0cbf3343
...@@ -78,7 +78,7 @@ struct can_priv { ...@@ -78,7 +78,7 @@ struct can_priv {
#define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC)) #define get_canfd_dlc(i) (min_t(__u8, (i), CANFD_MAX_DLC))
/* Drop a given socketbuffer if it does not contain a valid CAN frame. */ /* Drop a given socketbuffer if it does not contain a valid CAN frame. */
static inline int can_dropped_invalid_skb(struct net_device *dev, static inline bool can_dropped_invalid_skb(struct net_device *dev,
struct sk_buff *skb) struct sk_buff *skb)
{ {
const struct canfd_frame *cfd = (struct canfd_frame *)skb->data; const struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
...@@ -94,12 +94,12 @@ static inline int can_dropped_invalid_skb(struct net_device *dev, ...@@ -94,12 +94,12 @@ static inline int can_dropped_invalid_skb(struct net_device *dev,
} else } else
goto inval_skb; goto inval_skb;
return 0; return false;
inval_skb: inval_skb:
kfree_skb(skb); kfree_skb(skb);
dev->stats.tx_dropped++; dev->stats.tx_dropped++;
return 1; return true;
} }
static inline bool can_is_canfd_skb(const struct sk_buff *skb) static inline bool can_is_canfd_skb(const struct sk_buff *skb)
......
...@@ -202,16 +202,16 @@ struct dccp_service_list { ...@@ -202,16 +202,16 @@ struct dccp_service_list {
#define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1)
#define DCCP_SERVICE_CODE_IS_ABSENT 0 #define DCCP_SERVICE_CODE_IS_ABSENT 0
static inline int dccp_list_has_service(const struct dccp_service_list *sl, static inline bool dccp_list_has_service(const struct dccp_service_list *sl,
const __be32 service) const __be32 service)
{ {
if (likely(sl != NULL)) { if (likely(sl != NULL)) {
u32 i = sl->dccpsl_nr; u32 i = sl->dccpsl_nr;
while (i--) while (i--)
if (sl->dccpsl_list[i] == service) if (sl->dccpsl_list[i] == service)
return 1; return true;
} }
return 0; return false;
} }
struct dccp_ackvec; struct dccp_ackvec;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
extern void genl_lock(void); extern void genl_lock(void);
extern void genl_unlock(void); extern void genl_unlock(void);
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
extern int lockdep_genl_is_held(void); extern bool lockdep_genl_is_held(void);
#endif #endif
/* for synchronisation between af_netlink and genetlink */ /* for synchronisation between af_netlink and genetlink */
......
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
#define IEEE80211_MAX_SN IEEE80211_SN_MASK #define IEEE80211_MAX_SN IEEE80211_SN_MASK
#define IEEE80211_SN_MODULO (IEEE80211_MAX_SN + 1) #define IEEE80211_SN_MODULO (IEEE80211_MAX_SN + 1)
static inline int ieee80211_sn_less(u16 sn1, u16 sn2) static inline bool ieee80211_sn_less(u16 sn1, u16 sn2)
{ {
return ((sn1 - sn2) & IEEE80211_SN_MASK) > (IEEE80211_SN_MODULO >> 1); return ((sn1 - sn2) & IEEE80211_SN_MASK) > (IEEE80211_SN_MODULO >> 1);
} }
...@@ -250,7 +250,7 @@ struct ieee80211_qos_hdr { ...@@ -250,7 +250,7 @@ struct ieee80211_qos_hdr {
* ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_tods(__le16 fc) static inline bool ieee80211_has_tods(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_TODS)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_TODS)) != 0;
} }
...@@ -259,7 +259,7 @@ static inline int ieee80211_has_tods(__le16 fc) ...@@ -259,7 +259,7 @@ static inline int ieee80211_has_tods(__le16 fc)
* ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set * ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_fromds(__le16 fc) static inline bool ieee80211_has_fromds(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FROMDS)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_FROMDS)) != 0;
} }
...@@ -268,7 +268,7 @@ static inline int ieee80211_has_fromds(__le16 fc) ...@@ -268,7 +268,7 @@ static inline int ieee80211_has_fromds(__le16 fc)
* ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set * ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_a4(__le16 fc) static inline bool ieee80211_has_a4(__le16 fc)
{ {
__le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); __le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
return (fc & tmp) == tmp; return (fc & tmp) == tmp;
...@@ -278,7 +278,7 @@ static inline int ieee80211_has_a4(__le16 fc) ...@@ -278,7 +278,7 @@ static inline int ieee80211_has_a4(__le16 fc)
* ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set * ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_morefrags(__le16 fc) static inline bool ieee80211_has_morefrags(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) != 0;
} }
...@@ -287,7 +287,7 @@ static inline int ieee80211_has_morefrags(__le16 fc) ...@@ -287,7 +287,7 @@ static inline int ieee80211_has_morefrags(__le16 fc)
* ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set * ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_retry(__le16 fc) static inline bool ieee80211_has_retry(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_RETRY)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_RETRY)) != 0;
} }
...@@ -296,7 +296,7 @@ static inline int ieee80211_has_retry(__le16 fc) ...@@ -296,7 +296,7 @@ static inline int ieee80211_has_retry(__le16 fc)
* ieee80211_has_pm - check if IEEE80211_FCTL_PM is set * ieee80211_has_pm - check if IEEE80211_FCTL_PM is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_pm(__le16 fc) static inline bool ieee80211_has_pm(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_PM)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_PM)) != 0;
} }
...@@ -305,7 +305,7 @@ static inline int ieee80211_has_pm(__le16 fc) ...@@ -305,7 +305,7 @@ static inline int ieee80211_has_pm(__le16 fc)
* ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set * ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_moredata(__le16 fc) static inline bool ieee80211_has_moredata(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) != 0;
} }
...@@ -314,7 +314,7 @@ static inline int ieee80211_has_moredata(__le16 fc) ...@@ -314,7 +314,7 @@ static inline int ieee80211_has_moredata(__le16 fc)
* ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set * ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_protected(__le16 fc) static inline bool ieee80211_has_protected(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_PROTECTED)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_PROTECTED)) != 0;
} }
...@@ -323,7 +323,7 @@ static inline int ieee80211_has_protected(__le16 fc) ...@@ -323,7 +323,7 @@ static inline int ieee80211_has_protected(__le16 fc)
* ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set * ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_has_order(__le16 fc) static inline bool ieee80211_has_order(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_ORDER)) != 0; return (fc & cpu_to_le16(IEEE80211_FCTL_ORDER)) != 0;
} }
...@@ -332,7 +332,7 @@ static inline int ieee80211_has_order(__le16 fc) ...@@ -332,7 +332,7 @@ static inline int ieee80211_has_order(__le16 fc)
* ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT * ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_mgmt(__le16 fc) static inline bool ieee80211_is_mgmt(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT); cpu_to_le16(IEEE80211_FTYPE_MGMT);
...@@ -342,7 +342,7 @@ static inline int ieee80211_is_mgmt(__le16 fc) ...@@ -342,7 +342,7 @@ static inline int ieee80211_is_mgmt(__le16 fc)
* ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL * ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_ctl(__le16 fc) static inline bool ieee80211_is_ctl(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL); cpu_to_le16(IEEE80211_FTYPE_CTL);
...@@ -352,7 +352,7 @@ static inline int ieee80211_is_ctl(__le16 fc) ...@@ -352,7 +352,7 @@ static inline int ieee80211_is_ctl(__le16 fc)
* ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA * ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_data(__le16 fc) static inline bool ieee80211_is_data(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_DATA); cpu_to_le16(IEEE80211_FTYPE_DATA);
...@@ -362,7 +362,7 @@ static inline int ieee80211_is_data(__le16 fc) ...@@ -362,7 +362,7 @@ static inline int ieee80211_is_data(__le16 fc)
* ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set * ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_data_qos(__le16 fc) static inline bool ieee80211_is_data_qos(__le16 fc)
{ {
/* /*
* mask with QOS_DATA rather than IEEE80211_FCTL_STYPE as we just need * mask with QOS_DATA rather than IEEE80211_FCTL_STYPE as we just need
...@@ -376,7 +376,7 @@ static inline int ieee80211_is_data_qos(__le16 fc) ...@@ -376,7 +376,7 @@ static inline int ieee80211_is_data_qos(__le16 fc)
* ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data * ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_data_present(__le16 fc) static inline bool ieee80211_is_data_present(__le16 fc)
{ {
/* /*
* mask with 0x40 and test that that bit is clear to only return true * mask with 0x40 and test that that bit is clear to only return true
...@@ -390,7 +390,7 @@ static inline int ieee80211_is_data_present(__le16 fc) ...@@ -390,7 +390,7 @@ static inline int ieee80211_is_data_present(__le16 fc)
* ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ * ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_assoc_req(__le16 fc) static inline bool ieee80211_is_assoc_req(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ);
...@@ -400,7 +400,7 @@ static inline int ieee80211_is_assoc_req(__le16 fc) ...@@ -400,7 +400,7 @@ static inline int ieee80211_is_assoc_req(__le16 fc)
* ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP * ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_assoc_resp(__le16 fc) static inline bool ieee80211_is_assoc_resp(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_RESP); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_RESP);
...@@ -410,7 +410,7 @@ static inline int ieee80211_is_assoc_resp(__le16 fc) ...@@ -410,7 +410,7 @@ static inline int ieee80211_is_assoc_resp(__le16 fc)
* ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ * ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_reassoc_req(__le16 fc) static inline bool ieee80211_is_reassoc_req(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_REQ); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_REQ);
...@@ -420,7 +420,7 @@ static inline int ieee80211_is_reassoc_req(__le16 fc) ...@@ -420,7 +420,7 @@ static inline int ieee80211_is_reassoc_req(__le16 fc)
* ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP * ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_reassoc_resp(__le16 fc) static inline bool ieee80211_is_reassoc_resp(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_RESP); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_RESP);
...@@ -430,7 +430,7 @@ static inline int ieee80211_is_reassoc_resp(__le16 fc) ...@@ -430,7 +430,7 @@ static inline int ieee80211_is_reassoc_resp(__le16 fc)
* ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ * ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_probe_req(__le16 fc) static inline bool ieee80211_is_probe_req(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ);
...@@ -440,7 +440,7 @@ static inline int ieee80211_is_probe_req(__le16 fc) ...@@ -440,7 +440,7 @@ static inline int ieee80211_is_probe_req(__le16 fc)
* ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP * ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_probe_resp(__le16 fc) static inline bool ieee80211_is_probe_resp(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP);
...@@ -450,7 +450,7 @@ static inline int ieee80211_is_probe_resp(__le16 fc) ...@@ -450,7 +450,7 @@ static inline int ieee80211_is_probe_resp(__le16 fc)
* ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON * ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_beacon(__le16 fc) static inline bool ieee80211_is_beacon(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON);
...@@ -460,7 +460,7 @@ static inline int ieee80211_is_beacon(__le16 fc) ...@@ -460,7 +460,7 @@ static inline int ieee80211_is_beacon(__le16 fc)
* ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM * ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_atim(__le16 fc) static inline bool ieee80211_is_atim(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ATIM); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ATIM);
...@@ -470,7 +470,7 @@ static inline int ieee80211_is_atim(__le16 fc) ...@@ -470,7 +470,7 @@ static inline int ieee80211_is_atim(__le16 fc)
* ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC * ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_disassoc(__le16 fc) static inline bool ieee80211_is_disassoc(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DISASSOC); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DISASSOC);
...@@ -480,7 +480,7 @@ static inline int ieee80211_is_disassoc(__le16 fc) ...@@ -480,7 +480,7 @@ static inline int ieee80211_is_disassoc(__le16 fc)
* ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH * ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_auth(__le16 fc) static inline bool ieee80211_is_auth(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH);
...@@ -490,7 +490,7 @@ static inline int ieee80211_is_auth(__le16 fc) ...@@ -490,7 +490,7 @@ static inline int ieee80211_is_auth(__le16 fc)
* ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH * ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_deauth(__le16 fc) static inline bool ieee80211_is_deauth(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH);
...@@ -500,7 +500,7 @@ static inline int ieee80211_is_deauth(__le16 fc) ...@@ -500,7 +500,7 @@ static inline int ieee80211_is_deauth(__le16 fc)
* ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION * ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_action(__le16 fc) static inline bool ieee80211_is_action(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION); cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION);
...@@ -510,7 +510,7 @@ static inline int ieee80211_is_action(__le16 fc) ...@@ -510,7 +510,7 @@ static inline int ieee80211_is_action(__le16 fc)
* ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ * ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_back_req(__le16 fc) static inline bool ieee80211_is_back_req(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK_REQ); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK_REQ);
...@@ -520,7 +520,7 @@ static inline int ieee80211_is_back_req(__le16 fc) ...@@ -520,7 +520,7 @@ static inline int ieee80211_is_back_req(__le16 fc)
* ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK * ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_back(__le16 fc) static inline bool ieee80211_is_back(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK);
...@@ -530,7 +530,7 @@ static inline int ieee80211_is_back(__le16 fc) ...@@ -530,7 +530,7 @@ static inline int ieee80211_is_back(__le16 fc)
* ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL * ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_pspoll(__le16 fc) static inline bool ieee80211_is_pspoll(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL);
...@@ -540,7 +540,7 @@ static inline int ieee80211_is_pspoll(__le16 fc) ...@@ -540,7 +540,7 @@ static inline int ieee80211_is_pspoll(__le16 fc)
* ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS * ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_rts(__le16 fc) static inline bool ieee80211_is_rts(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
...@@ -550,7 +550,7 @@ static inline int ieee80211_is_rts(__le16 fc) ...@@ -550,7 +550,7 @@ static inline int ieee80211_is_rts(__le16 fc)
* ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS * ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_cts(__le16 fc) static inline bool ieee80211_is_cts(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
...@@ -560,7 +560,7 @@ static inline int ieee80211_is_cts(__le16 fc) ...@@ -560,7 +560,7 @@ static inline int ieee80211_is_cts(__le16 fc)
* ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK * ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_ack(__le16 fc) static inline bool ieee80211_is_ack(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK);
...@@ -570,7 +570,7 @@ static inline int ieee80211_is_ack(__le16 fc) ...@@ -570,7 +570,7 @@ static inline int ieee80211_is_ack(__le16 fc)
* ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND * ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_cfend(__le16 fc) static inline bool ieee80211_is_cfend(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFEND); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFEND);
...@@ -580,7 +580,7 @@ static inline int ieee80211_is_cfend(__le16 fc) ...@@ -580,7 +580,7 @@ static inline int ieee80211_is_cfend(__le16 fc)
* ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK * ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_cfendack(__le16 fc) static inline bool ieee80211_is_cfendack(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFENDACK); cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFENDACK);
...@@ -590,7 +590,7 @@ static inline int ieee80211_is_cfendack(__le16 fc) ...@@ -590,7 +590,7 @@ static inline int ieee80211_is_cfendack(__le16 fc)
* ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_nullfunc(__le16 fc) static inline bool ieee80211_is_nullfunc(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
...@@ -600,7 +600,7 @@ static inline int ieee80211_is_nullfunc(__le16 fc) ...@@ -600,7 +600,7 @@ static inline int ieee80211_is_nullfunc(__le16 fc)
* ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame
* @fc: frame control bytes in little-endian byteorder * @fc: frame control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_qos_nullfunc(__le16 fc) static inline bool ieee80211_is_qos_nullfunc(__le16 fc)
{ {
return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC);
...@@ -624,7 +624,7 @@ static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc) ...@@ -624,7 +624,7 @@ static inline bool ieee80211_is_bufferable_mmpdu(__le16 fc)
* ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set * ieee80211_is_first_frag - check if IEEE80211_SCTL_FRAG is not set
* @seq_ctrl: frame sequence control bytes in little-endian byteorder * @seq_ctrl: frame sequence control bytes in little-endian byteorder
*/ */
static inline int ieee80211_is_first_frag(__le16 seq_ctrl) static inline bool ieee80211_is_first_frag(__le16 seq_ctrl)
{ {
return (seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0; return (seq_ctrl & cpu_to_le16(IEEE80211_SCTL_FRAG)) == 0;
} }
......
...@@ -171,7 +171,7 @@ __be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst, ...@@ -171,7 +171,7 @@ __be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst,
__be32 local, int scope); __be32 local, int scope);
struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
__be32 mask); __be32 mask);
static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) static __inline__ bool inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
{ {
return !((addr^ifa->ifa_address)&ifa->ifa_mask); return !((addr^ifa->ifa_address)&ifa->ifa_mask);
} }
...@@ -180,15 +180,15 @@ static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) ...@@ -180,15 +180,15 @@ static __inline__ int 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; \
......
...@@ -45,11 +45,11 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid, ...@@ -45,11 +45,11 @@ int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
void nfnl_lock(__u8 subsys_id); void nfnl_lock(__u8 subsys_id);
void nfnl_unlock(__u8 subsys_id); void nfnl_unlock(__u8 subsys_id);
#ifdef CONFIG_PROVE_LOCKING #ifdef CONFIG_PROVE_LOCKING
int lockdep_nfnl_is_held(__u8 subsys_id); bool lockdep_nfnl_is_held(__u8 subsys_id);
#else #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 */ #endif /* CONFIG_PROVE_LOCKING */
......
...@@ -33,11 +33,11 @@ extern wait_queue_head_t netdev_unregistering_wq; ...@@ -33,11 +33,11 @@ extern wait_queue_head_t netdev_unregistering_wq;
extern struct mutex net_mutex; extern struct mutex net_mutex;
#ifdef CONFIG_PROVE_LOCKING #ifdef CONFIG_PROVE_LOCKING
extern int lockdep_rtnl_is_held(void); extern bool lockdep_rtnl_is_held(void);
#else #else
static inline int lockdep_rtnl_is_held(void) static inline bool lockdep_rtnl_is_held(void)
{ {
return 1; return true;
} }
#endif /* #ifdef CONFIG_PROVE_LOCKING */ #endif /* #ifdef CONFIG_PROVE_LOCKING */
......
...@@ -96,7 +96,7 @@ int rtnl_is_locked(void) ...@@ -96,7 +96,7 @@ int rtnl_is_locked(void)
EXPORT_SYMBOL(rtnl_is_locked); EXPORT_SYMBOL(rtnl_is_locked);
#ifdef CONFIG_PROVE_LOCKING #ifdef CONFIG_PROVE_LOCKING
int lockdep_rtnl_is_held(void) bool lockdep_rtnl_is_held(void)
{ {
return lockdep_is_held(&rtnl_mutex); return lockdep_is_held(&rtnl_mutex);
} }
......
...@@ -325,13 +325,13 @@ void dccp_send_close(struct sock *sk, const int active); ...@@ -325,13 +325,13 @@ void dccp_send_close(struct sock *sk, const int active);
int dccp_invalid_packet(struct sk_buff *skb); int dccp_invalid_packet(struct sk_buff *skb);
u32 dccp_sample_rtt(struct sock *sk, long delta); u32 dccp_sample_rtt(struct sock *sk, long delta);
static inline int dccp_bad_service_code(const struct sock *sk, static inline bool dccp_bad_service_code(const struct sock *sk,
const __be32 service) const __be32 service)
{ {
const struct dccp_sock *dp = dccp_sk(sk); const struct dccp_sock *dp = dccp_sk(sk);
if (dp->dccps_service == service) if (dp->dccps_service == service)
return 0; return false;
return !dccp_list_has_service(dp->dccps_service_list, service); return !dccp_list_has_service(dp->dccps_service_list, service);
} }
......
...@@ -64,7 +64,7 @@ void nfnl_unlock(__u8 subsys_id) ...@@ -64,7 +64,7 @@ void nfnl_unlock(__u8 subsys_id)
EXPORT_SYMBOL_GPL(nfnl_unlock); EXPORT_SYMBOL_GPL(nfnl_unlock);
#ifdef CONFIG_PROVE_LOCKING #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); return lockdep_is_held(&table[subsys_id].mutex);
} }
......
...@@ -39,7 +39,7 @@ void genl_unlock(void) ...@@ -39,7 +39,7 @@ void genl_unlock(void)
EXPORT_SYMBOL(genl_unlock); EXPORT_SYMBOL(genl_unlock);
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
int lockdep_genl_is_held(void) bool lockdep_genl_is_held(void)
{ {
return lockdep_is_held(&genl_mutex); return lockdep_is_held(&genl_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment