linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH mac80211-next] ath10k: fix unhandled switch value warning
@ 2020-07-31  5:56 Thomas Pedersen
  2020-08-14 17:15 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Pedersen @ 2020-07-31  5:56 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, ath10k, sfr, Thomas Pedersen

Cited commit introduced the following warnings:

drivers/net/wireless/ath/ath10k/mac.c: In function 'chan_to_phymode':
drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_1' not handled in switch [-Wswitch]
  558 |   switch (chandef->width) {
      |   ^~~~~~
drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_2' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_4' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_8' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration value 'NL80211_CHAN_WIDTH_16' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_1' not handled in switch [-Wswitch]
  581 |   switch (chandef->width) {
      |   ^~~~~~
drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_2' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_4' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_8' not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_16' not handled in switch [-Wswitch]

Fix them by making the existing invalid channel width
cases the default, as the introduced channel widths
currently don't make sense in 2 or 5GHz either.

Fixes: e5cb3d34a66d ("nl80211: S1G band and channel definitions")
Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 919d15584d4a..3c0c33a9f30c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -568,11 +568,7 @@ chan_to_phymode(const struct cfg80211_chan_def *chandef)
 		case NL80211_CHAN_WIDTH_40:
 			phymode = MODE_11NG_HT40;
 			break;
-		case NL80211_CHAN_WIDTH_5:
-		case NL80211_CHAN_WIDTH_10:
-		case NL80211_CHAN_WIDTH_80:
-		case NL80211_CHAN_WIDTH_80P80:
-		case NL80211_CHAN_WIDTH_160:
+		default:
 			phymode = MODE_UNKNOWN;
 			break;
 		}
@@ -597,8 +593,7 @@ chan_to_phymode(const struct cfg80211_chan_def *chandef)
 		case NL80211_CHAN_WIDTH_80P80:
 			phymode = MODE_11AC_VHT80_80;
 			break;
-		case NL80211_CHAN_WIDTH_5:
-		case NL80211_CHAN_WIDTH_10:
+		default:
 			phymode = MODE_UNKNOWN;
 			break;
 		}
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH mac80211-next] ath10k: fix unhandled switch value warning
  2020-07-31  5:56 [PATCH mac80211-next] ath10k: fix unhandled switch value warning Thomas Pedersen
@ 2020-08-14 17:15 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2020-08-14 17:15 UTC (permalink / raw)
  To: Thomas Pedersen; +Cc: Johannes Berg, linux-wireless, ath10k, sfr

Thomas Pedersen <thomas@adapt-ip.com> writes:

> Cited commit introduced the following warnings:
>
> drivers/net/wireless/ath/ath10k/mac.c: In function 'chan_to_phymode':
> drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration
> value 'NL80211_CHAN_WIDTH_1' not handled in switch [-Wswitch]
>   558 |   switch (chandef->width) {
>       |   ^~~~~~
> drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration
> value 'NL80211_CHAN_WIDTH_2' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration
> value 'NL80211_CHAN_WIDTH_4' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration
> value 'NL80211_CHAN_WIDTH_8' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:558:3: warning: enumeration
> value 'NL80211_CHAN_WIDTH_16' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration
> value 'NL80211_CHAN_WIDTH_1' not handled in switch [-Wswitch]
>   581 |   switch (chandef->width) {
>       |   ^~~~~~
> drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_2' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_4' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_8' not handled in switch [-Wswitch]
> drivers/net/wireless/ath/ath10k/mac.c:581:3: warning: enumeration value 'NL80211_CHAN_WIDTH_16' not handled in switch [-Wswitch]
>
> Fix them by making the existing invalid channel width
> cases the default, as the introduced channel widths
> currently don't make sense in 2 or 5GHz either.
>
> Fixes: e5cb3d34a66d ("nl80211: S1G band and channel definitions")
> Signed-off-by: Thomas Pedersen <thomas@adapt-ip.com>

I assume Johannes takes this so:

Acked-by: Kalle Valo <kvalo@codeaurora.org>

-- 
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-14 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-31  5:56 [PATCH mac80211-next] ath10k: fix unhandled switch value warning Thomas Pedersen
2020-08-14 17:15 ` Kalle Valo

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).