[PATCH mac80211-next] ath10k: fix unhandled switch value warning

Kalle Valo kvalo at codeaurora.org
Fri Aug 14 13:15:53 EDT 2020


Thomas Pedersen <thomas at 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 at adapt-ip.com>

I assume Johannes takes this so:

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

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



More information about the ath10k mailing list