Commit 6b59db7d authored by Zhao, Gang's avatar Zhao, Gang Committed by Johannes Berg

mac80211: return bool instead of numbers in yes/no function

And some code style changes in the function, and correct a typo in
comment.
Signed-off-by: default avatarZhao, Gang <gamerh2o@gmail.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 17d38fa8
...@@ -54,24 +54,25 @@ static struct sk_buff *remove_monitor_info(struct ieee80211_local *local, ...@@ -54,24 +54,25 @@ static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,
return skb; return skb;
} }
static inline int should_drop_frame(struct sk_buff *skb, int present_fcs_len) static inline bool should_drop_frame(struct sk_buff *skb, int present_fcs_len)
{ {
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb); struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *hdr; struct ieee80211_hdr *hdr = (void *)skb->data;
hdr = (void *)(skb->data);
if (status->flag & (RX_FLAG_FAILED_FCS_CRC | if (status->flag & (RX_FLAG_FAILED_FCS_CRC |
RX_FLAG_FAILED_PLCP_CRC | RX_FLAG_FAILED_PLCP_CRC |
RX_FLAG_AMPDU_IS_ZEROLEN)) RX_FLAG_AMPDU_IS_ZEROLEN))
return 1; return true;
if (unlikely(skb->len < 16 + present_fcs_len)) if (unlikely(skb->len < 16 + present_fcs_len))
return 1; return true;
if (ieee80211_is_ctl(hdr->frame_control) && if (ieee80211_is_ctl(hdr->frame_control) &&
!ieee80211_is_pspoll(hdr->frame_control) && !ieee80211_is_pspoll(hdr->frame_control) &&
!ieee80211_is_back_req(hdr->frame_control)) !ieee80211_is_back_req(hdr->frame_control))
return 1; return true;
return 0;
return false;
} }
static int static int
...@@ -3190,7 +3191,7 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, ...@@ -3190,7 +3191,7 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
} }
/* /*
* This is the actual Rx frames handler. as it blongs to Rx path it must * This is the actual Rx frames handler. as it belongs to Rx path it must
* be called with rcu_read_lock protection. * be called with rcu_read_lock protection.
*/ */
static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
......
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