wl18xx: Fix Wunused-const-variable
Subsystems (3)
PATCH 1/1 wl18xx: Fix Wunused-const-variable
Clang produces the following warning
drivers/net/wireless/ti/wl18xx/main.c:1850:43: warning: unused variable 'wl18xx_iface_ap_cl_limits' [-Wunused-const-variable] static const struct ieee80211_iface_limit wl18xx_iface_ap_cl_limits[] = { ^ drivers/net/wireless/ti/wl18xx/main.c:1869:43: warning: unused variable 'wl18xx_iface_ap_go_limits' [-Wunused-const-variable] static const struct ieee80211_iface_limit wl18xx_iface_ap_go_limits[] = { ^
The commit that added these variables never used them. Removing them.
--- drivers/net/wireless/ti/wl18xx/main.c | 38 --------------------------- 1 file changed, 38 deletions(-)
drivers/net/wireless/ti/wl18xx/main.c +0 -38
@@ -1847,44 +1847,6 @@ static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = { }, }; -static const struct ieee80211_iface_limit wl18xx_iface_ap_cl_limits[] = { - { - .max =1 , - .types =BIT (NL80211_IFTYPE_STATION ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_AP ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_CLIENT ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_DEVICE ), - }, -}; - -static const struct ieee80211_iface_limit wl18xx_iface_ap_go_limits[] = { - { - .max =1 , - .types =BIT (NL80211_IFTYPE_STATION ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_AP ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_GO ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_DEVICE ), - }, -}; -static const struct ieee80211_iface_combination wl18xx_iface_combinations[] = { {
Signature · 1 line
2.22.0.rc2.383.gf4fbbf30c2-goog
Quoted 11 lines · Nathan Huckleberry' via Clang Built Linux
Clang produces the following warning
drivers/net/wireless/ti/wl18xx/main.c:1850:43: warning: unused variable 'wl18xx_iface_ap_cl_limits' [-Wunused-const-variable] static const structieee80211_iface_limitwl18xx_iface_ap_cl_limits[] = { ^drivers/net/wireless/ti/wl18xx/main.c:1869:43: warning: unused variable 'wl18xx_iface_ap_go_limits' [-Wunused-const-variable] static const structieee80211_iface_limitwl18xx_iface_ap_go_limits[] = { ^The commit that added these variables never used them. Removing them.
Previous thread, for context:
https://groups.google.com/forum/#!topic/clang-built-linux/1Lu1GT9ic94
Looking at drivers/net/wireless/ti/wl18xx/main.c, there 4 globally declared struct ieee80211_iface_limit but as your patch notes, only 2 are used. The thing is, their uses are in a struct ieee80211_iface_limit [].
Looking at
$ git blame drivers/net/wireless/ti/wl18xx/main.c -L 1850
points to
commit 7845af35e0de ("wlcore: add p2p device support")
Adding Eliad and Arik to the thread; it's not clear to me what the
these variables were supposed to do, but seeing as the code in
question was already dead, this is no functional change from a user's
perspective. With that in mind:
Reviewed-by: Nick Desaulniers <[email protected]>So I'd at least add the tag.
Quoted 44 lines
drivers/net/wireless/ti/wl18xx/main.c +0
-38@@ -1847,44 +1847,6 @@ static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = { }, }; -static const struct ieee80211_iface_limit wl18xx_iface_ap_cl_limits[] = { - { - .max =1 , - .types =BIT (NL80211_IFTYPE_STATION ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_AP ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_CLIENT ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_DEVICE ), - }, -}; - -static const struct ieee80211_iface_limit wl18xx_iface_ap_go_limits[] = { - { - .max =1 , - .types =BIT (NL80211_IFTYPE_STATION ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_AP ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_GO ), - }, - { - .max =1 , - .types =BIT (NL80211_IFTYPE_P2P_DEVICE ), - }, -}; -
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 4 lines · Nick Desaulniers
Looking at
drivers/net/wireless/ti/wl18xx/main.c, there 4 globally declaredstruct ieee80211_iface_limitbut as your patch notes, only 2 are used. The thing is, their uses are in astruct ieee80211_iface_limit [].
Sorry, that's not quite right; it's not a struct ieee80211_iface_limit [] but a struct ieee80211_iface_combination []. No idea what other values we'd put to add these limits to the array.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 32 lines · Nick Desaulniers
Quoted 11 lines · Nathan Huckleberry' via Clang Built Linux
Clang produces the following warning
drivers/net/wireless/ti/wl18xx/main.c:1850:43: warning: unused variable 'wl18xx_iface_ap_cl_limits' [-Wunused-const-variable] static const structieee80211_iface_limitwl18xx_iface_ap_cl_limits[] = { ^drivers/net/wireless/ti/wl18xx/main.c:1869:43: warning: unused variable 'wl18xx_iface_ap_go_limits' [-Wunused-const-variable] static const structieee80211_iface_limitwl18xx_iface_ap_go_limits[] = { ^The commit that added these variables never used them. Removing them.
Previous thread, for context:
https://groups.google.com/forum/#!topic/clang-built-linux/1Lu1GT9ic94Looking at
drivers/net/wireless/ti/wl18xx/main.c, there 4 globally declaredstruct ieee80211_iface_limitbut as your patch notes, only 2 are used. The thing is, their uses are in astruct ieee80211_iface_limit [].Looking at
$ git blame drivers/net/wireless/ti/wl18xx/main.c -L 1850 points to commit 7845af35e0de ("wlcore: add p2p device support") Adding Eliad and Arik to the thread; it's not clear to me what the these variables were supposed to do, but seeing as the code in question was already dead, this is no functional change from a user's perspective. With that in mind: Reviewed-by: Nick Desaulniers <[email protected]>
Quoted 2 lines
So I'd at least add the tag.
Fixes 7845af35e0de ("wlcore: add p2p device support")
I can't see any functional changes when applying this patch so I don't think a fixes line is needed, it's just cleanup.
Signature · 1 line
Kalle Valo
Quoted 9 lines · Nathan Huckleberry
Clang produces the following warning
drivers/net/wireless/ti/wl18xx/main.c:1850:43: warning: unused variable 'wl18xx_iface_ap_cl_limits' [-Wunused-const-variable] static const structieee80211_iface_limitwl18xx_iface_ap_cl_limits[] = { ^drivers/net/wireless/ti/wl18xx/main.c:1869:43: warning: unused variable 'wl18xx_iface_ap_go_limits' [-Wunused-const-variable] static const structieee80211_iface_limitwl18xx_iface_ap_go_limits[] = { ^
Quoted 6 lines
The commit that added these variables never used them. Removing them.
Patch applied to wireless-drivers.git, thanks.
608fd7214323 wl18xx: Fix Wunused-const-variable
Signature · 3 lines
https://patchwork.kernel.org/patch/10996073/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches