提交 30ccb088 编写于 作者: M Michael Buesch 提交者: David S. Miller

[PATCH] mac80211: bss_tim_clear must use ~ instead of !

We need to use bitwise NOT.
This also cleans up the code a little bit to make it more readable.
Signed-off-by: NMichael Buesch <mb@bu3sch.de>
Reviewed-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b4010e08
...@@ -642,34 +642,34 @@ struct sta_attribute { ...@@ -642,34 +642,34 @@ struct sta_attribute {
ssize_t (*store)(struct sta_info *, const char *buf, size_t count); ssize_t (*store)(struct sta_info *, const char *buf, size_t count);
}; };
static inline void __bss_tim_set(struct ieee80211_if_ap *bss, int aid) static inline void __bss_tim_set(struct ieee80211_if_ap *bss, u16 aid)
{ {
/* /*
* This format has ben mandated by the IEEE specifications, * This format has been mandated by the IEEE specifications,
* so this line may not be changed to use the __set_bit() format. * so this line may not be changed to use the __set_bit() format.
*/ */
bss->tim[(aid)/8] |= 1<<((aid) % 8); bss->tim[aid / 8] |= (1 << (aid % 8));
} }
static inline void bss_tim_set(struct ieee80211_local *local, static inline void bss_tim_set(struct ieee80211_local *local,
struct ieee80211_if_ap *bss, int aid) struct ieee80211_if_ap *bss, u16 aid)
{ {
read_lock_bh(&local->sta_lock); read_lock_bh(&local->sta_lock);
__bss_tim_set(bss, aid); __bss_tim_set(bss, aid);
read_unlock_bh(&local->sta_lock); read_unlock_bh(&local->sta_lock);
} }
static inline void __bss_tim_clear(struct ieee80211_if_ap *bss, int aid) static inline void __bss_tim_clear(struct ieee80211_if_ap *bss, u16 aid)
{ {
/* /*
* This format has ben mandated by the IEEE specifications, * This format has been mandated by the IEEE specifications,
* so this line may not be changed to use the __clear_bit() format. * so this line may not be changed to use the __clear_bit() format.
*/ */
bss->tim[(aid)/8] &= !(1<<((aid) % 8)); bss->tim[aid / 8] &= ~(1 << (aid % 8));
} }
static inline void bss_tim_clear(struct ieee80211_local *local, static inline void bss_tim_clear(struct ieee80211_local *local,
struct ieee80211_if_ap *bss, int aid) struct ieee80211_if_ap *bss, u16 aid)
{ {
read_lock_bh(&local->sta_lock); read_lock_bh(&local->sta_lock);
__bss_tim_clear(bss, aid); __bss_tim_clear(bss, aid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册