From: Johannes Berg <johannes@sipsolutions.net>
To: Michael Buesch <mb@bu3sch.de>
Cc: John Linville <linville@tuxdriver.com>,
Michael Wu <flamingice@sourmilk.net>,
linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: bss_tim_clear must use ~ instead of !
Date: Wed, 26 Sep 2007 21:15:56 +0200 [thread overview]
Message-ID: <1190834156.16048.7.camel@johannes.berg> (raw)
In-Reply-To: <200709262108.47882.mb@bu3sch.de>
On Wed, 2007-09-26 at 21:08 +0200, Michael Buesch wrote:
> We need to use bitwise NOT.
> This also cleans up the code a little bit to make it more readable.
>
> Signed-off-by: Michael Buesch <mb@bu3sch.de>
Looks good, thanks
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
> Index: wireless-2.6/net/mac80211/ieee80211_i.h
> ===================================================================
> --- wireless-2.6.orig/net/mac80211/ieee80211_i.h 2007-09-26 21:04:03.000000000 +0200
> +++ wireless-2.6/net/mac80211/ieee80211_i.h 2007-09-26 21:04:05.000000000 +0200
> @@ -648,34 +648,34 @@ struct sta_attribute {
> 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.
> */
> - bss->tim[(aid)/8] |= 1<<((aid) % 8);
> + bss->tim[aid / 8] |= (1 << (aid % 8));
> }
>
> 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);
> __bss_tim_set(bss, aid);
> 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.
> */
> - bss->tim[(aid)/8] &= !(1<<((aid) % 8));
> + bss->tim[aid / 8] &= ~(1 << (aid % 8));
> }
>
> 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);
> __bss_tim_clear(bss, aid);
>
prev parent reply other threads:[~2007-09-26 19:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-26 19:08 [PATCH] mac80211: bss_tim_clear must use ~ instead of ! Michael Buesch
2007-09-26 19:15 ` Johannes Berg [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1190834156.16048.7.camel@johannes.berg \
--to=johannes@sipsolutions.net \
--cc=flamingice@sourmilk.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mb@bu3sch.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox