* [PATCH] cfg80211: only pass sband to set_mandatory_flags_band()
@ 2017-01-04 10:53 Arend van Spriel
2017-01-05 11:59 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Arend van Spriel @ 2017-01-04 10:53 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless, Arend van Spriel
The supported band structure contains the band is applies to
so no need to pass it separately. Also added a default case
to the switch for completeness. The current code base does not
call this function with NUM_NL80211_BANDS but kept that case
statement although default case would cover that.
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
Stumbled upon this function and wanted to start the new year lightly.
It applies to master branch of mac80211-next repo.
Best wishes,
Arend
---
net/wireless/util.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 2cf7df8..c91bc25 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -136,12 +136,11 @@ struct ieee80211_channel *ieee80211_get_channel(struct wiphy *wiphy, int freq)
}
EXPORT_SYMBOL(ieee80211_get_channel);
-static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
- enum nl80211_band band)
+static void set_mandatory_flags_band(struct ieee80211_supported_band *sband)
{
int i, want;
- switch (band) {
+ switch (sband->band) {
case NL80211_BAND_5GHZ:
want = 3;
for (i = 0; i < sband->n_bitrates; i++) {
@@ -191,6 +190,7 @@ static void set_mandatory_flags_band(struct ieee80211_supported_band *sband,
WARN_ON((sband->ht_cap.mcs.rx_mask[0] & 0x1e) != 0x1e);
break;
case NUM_NL80211_BANDS:
+ default:
WARN_ON(1);
break;
}
@@ -202,7 +202,7 @@ void ieee80211_set_bitrate_flags(struct wiphy *wiphy)
for (band = 0; band < NUM_NL80211_BANDS; band++)
if (wiphy->bands[band])
- set_mandatory_flags_band(wiphy->bands[band], band);
+ set_mandatory_flags_band(wiphy->bands[band]);
}
bool cfg80211_supported_cipher_suite(struct wiphy *wiphy, u32 cipher)
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] cfg80211: only pass sband to set_mandatory_flags_band()
2017-01-04 10:53 [PATCH] cfg80211: only pass sband to set_mandatory_flags_band() Arend van Spriel
@ 2017-01-05 11:59 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2017-01-05 11:59 UTC (permalink / raw)
To: Arend van Spriel; +Cc: linux-wireless
On Wed, 2017-01-04 at 10:53 +0000, Arend van Spriel wrote:
> The supported band structure contains the band is applies to
> so no need to pass it separately. Also added a default case
> to the switch for completeness. The current code base does not
> call this function with NUM_NL80211_BANDS but kept that case
> statement although default case would cover that.
>
> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> ---
> Stumbled upon this function and wanted to start the new year lightly.
> It applies to master branch of mac80211-next repo.
Some light finger exercises to warm up for the year? :-)
Applied, thanks
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-05 12:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-04 10:53 [PATCH] cfg80211: only pass sband to set_mandatory_flags_band() Arend van Spriel
2017-01-05 11:59 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox