From: Johannes Berg <johannes@sipsolutions.net>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: remove hw.conf.channel usage where possible
Date: Wed, 28 Mar 2012 13:17:53 +0200 [thread overview]
Message-ID: <1332933473.3479.31.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1332932064-13758-1-git-send-email-michal.kazior@tieto.com>
On Wed, 2012-03-28 at 12:54 +0200, Michal Kazior wrote:
> Removes hw.conf.channel usage from the following functions:
> * ieee80211_mandatory_rates
> * ieee80211_sta_get_rates
> * ieee80211_frame_duration
>
> This is in preparation for multi-channel operation.
Nice, thanks.
> @@ -120,7 +120,7 @@ int ieee80211_frame_duration(struct ieee80211_local *local, size_t len,
> * DIV_ROUND_UP() operations.
> */
>
> - if (local->hw.conf.channel->band == IEEE80211_BAND_5GHZ || erp) {
> + if (!WARN_ON(!sband) && sband->band == IEEE80211_BAND_5GHZ || erp) {
This seems a bit odd to me, maybe change to
if (WARN_ON(!sband))
return 0;
if (sband->band == ... || erp)
...
or something like that? Or is there any code that has to pass NULL for
some reason?
Also, now that I think about it, is there a reason to pass
struct ieee80211_supported_band *sband
rather than
enum ieee80211_band band?
That wouldn't allow invalid/NULL value of course.
> __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
> struct ieee80211_vif *vif,
> + struct ieee80211_supported_band *sband,
same here.
Other than that, which may be needed, this looks good to me.
johannes
next prev parent reply other threads:[~2012-03-28 11:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-28 10:54 [PATCH] mac80211: remove hw.conf.channel usage where possible Michal Kazior
2012-03-28 11:17 ` Johannes Berg [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-03-29 7:01 Michal Kazior
2012-03-29 7:07 ` Johannes Berg
2012-04-10 19:20 ` John W. Linville
2012-04-11 6:22 ` Michal Kazior
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=1332933473.3479.31.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=michal.kazior@tieto.com \
/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;
as well as URLs for NNTP newsgroup(s).