diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-06-22 14:50:40 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-06-25 15:32:47 -0400 |
commit | e843bb199ba58ce5d1364d4c82fcf6975f08eec2 (patch) | |
tree | f40052d5af78b985f7c19ebff2a7ea9b99d85b8b /drivers | |
parent | 363c1b4f75d7a8cec61b74ee163f1f315a56f639 (diff) |
net/wireless/brcm80211/brcmfmac: Make return type and name reflect actual semantics
Applying ++ to a bool is equivalent to setting it true, regardless of
its initial value (bools are not uint1_t). Hence the function
wl_get_vif_state_all can only ever return true/false. The only in-tree
caller uses its return value as a boolean. So update its return type,
and since the list traversal and bit testing have no side effects,
just return true immediately. Its return value tells if any vif is in
the specified state, so also rename it to brcmf_get_vif_state_any.
Reviewed-by: Arend van Spriel<arend@broadcom.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/p2p.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c index f3445ac627e4..588fdbdb3255 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c | |||
@@ -708,7 +708,7 @@ static s32 brcmf_p2p_escan(struct brcmf_p2p_info *p2p, u32 num_chans, | |||
708 | active = P2PAPI_SCAN_SOCIAL_DWELL_TIME_MS; | 708 | active = P2PAPI_SCAN_SOCIAL_DWELL_TIME_MS; |
709 | else if (num_chans == AF_PEER_SEARCH_CNT) | 709 | else if (num_chans == AF_PEER_SEARCH_CNT) |
710 | active = P2PAPI_SCAN_AF_SEARCH_DWELL_TIME_MS; | 710 | active = P2PAPI_SCAN_AF_SEARCH_DWELL_TIME_MS; |
711 | else if (wl_get_vif_state_all(p2p->cfg, BRCMF_VIF_STATUS_CONNECTED)) | 711 | else if (brcmf_get_vif_state_any(p2p->cfg, BRCMF_VIF_STATUS_CONNECTED)) |
712 | active = -1; | 712 | active = -1; |
713 | else | 713 | else |
714 | active = P2PAPI_SCAN_DWELL_TIME_MS; | 714 | active = P2PAPI_SCAN_DWELL_TIME_MS; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index db3d8487dc42..cec55fc26f2e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -5619,16 +5619,15 @@ enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp) | |||
5619 | return wdev->iftype; | 5619 | return wdev->iftype; |
5620 | } | 5620 | } |
5621 | 5621 | ||
5622 | u32 wl_get_vif_state_all(struct brcmf_cfg80211_info *cfg, unsigned long state) | 5622 | bool brcmf_get_vif_state_any(struct brcmf_cfg80211_info *cfg, unsigned long state) |
5623 | { | 5623 | { |
5624 | struct brcmf_cfg80211_vif *vif; | 5624 | struct brcmf_cfg80211_vif *vif; |
5625 | bool result = 0; | ||
5626 | 5625 | ||
5627 | list_for_each_entry(vif, &cfg->vif_list, list) { | 5626 | list_for_each_entry(vif, &cfg->vif_list, list) { |
5628 | if (test_bit(state, &vif->sme_state)) | 5627 | if (test_bit(state, &vif->sme_state)) |
5629 | result++; | 5628 | return true; |
5630 | } | 5629 | } |
5631 | return result; | 5630 | return false; |
5632 | } | 5631 | } |
5633 | 5632 | ||
5634 | static inline bool vif_event_equals(struct brcmf_cfg80211_vif_event *event, | 5633 | static inline bool vif_event_equals(struct brcmf_cfg80211_vif_event *event, |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h index 283c525a44f7..f9fb10998e79 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | |||
@@ -477,7 +477,7 @@ const struct brcmf_tlv * | |||
477 | brcmf_parse_tlvs(const void *buf, int buflen, uint key); | 477 | brcmf_parse_tlvs(const void *buf, int buflen, uint key); |
478 | u16 channel_to_chanspec(struct brcmu_d11inf *d11inf, | 478 | u16 channel_to_chanspec(struct brcmu_d11inf *d11inf, |
479 | struct ieee80211_channel *ch); | 479 | struct ieee80211_channel *ch); |
480 | u32 wl_get_vif_state_all(struct brcmf_cfg80211_info *cfg, unsigned long state); | 480 | bool brcmf_get_vif_state_any(struct brcmf_cfg80211_info *cfg, unsigned long state); |
481 | void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg, | 481 | void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg, |
482 | struct brcmf_cfg80211_vif *vif); | 482 | struct brcmf_cfg80211_vif *vif); |
483 | bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg); | 483 | bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg); |