linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wl18xx: Fix Wunused-const-variable
@ 2019-06-14 17:17 Nathan Huckleberry
  2019-06-14 20:54 ` Nick Desaulniers
  2019-06-24 13:22 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Huckleberry @ 2019-06-14 17:17 UTC (permalink / raw)
  To: kvalo, davem
  Cc: linux-wireless, netdev, linux-kernel, Nathan Huckleberry,
	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 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.

Cc: clang-built-linux@googlegroups.com
Link: https://github.com/ClangBuiltLinux/linux/issues/530
Signed-off-by: Nathan Huckleberry <nhuck@google.com>
---
 drivers/net/wireless/ti/wl18xx/main.c | 38 ---------------------------
 1 file changed, 38 deletions(-)

diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index a5e0604d3009..0b3cf8477c6c 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -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[] = {
 	{
-- 
2.22.0.rc2.383.gf4fbbf30c2-goog


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

* Re: [PATCH] wl18xx: Fix Wunused-const-variable
  2019-06-14 17:17 [PATCH] wl18xx: Fix Wunused-const-variable Nathan Huckleberry
@ 2019-06-14 20:54 ` Nick Desaulniers
  2019-06-14 20:57   ` Nick Desaulniers
  2019-06-17  7:44   ` Kalle Valo
  2019-06-24 13:22 ` Kalle Valo
  1 sibling, 2 replies; 5+ messages in thread
From: Nick Desaulniers @ 2019-06-14 20:54 UTC (permalink / raw)
  To: Nathan Huckleberry, eliad, arik
  Cc: Kalle Valo, David S. Miller, linux-wireless, netdev, LKML,
	clang-built-linux

On Fri, Jun 14, 2019 at 10:17 AM 'Nathan Huckleberry' via Clang Built
Linux <clang-built-linux@googlegroups.com> wrote:
>
> 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.

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 <ndesaulniers@google.com>

So I'd at least add the tag.
Fixes: 7845af35e0de ("wlcore: add p2p device support")

> --- a/drivers/net/wireless/ti/wl18xx/main.c
> +++ b/drivers/net/wireless/ti/wl18xx/main.c
> @@ -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),
> -       },
> -};
> -

-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] wl18xx: Fix Wunused-const-variable
  2019-06-14 20:54 ` Nick Desaulniers
@ 2019-06-14 20:57   ` Nick Desaulniers
  2019-06-17  7:44   ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Nick Desaulniers @ 2019-06-14 20:57 UTC (permalink / raw)
  To: Nathan Huckleberry, eliad, arik
  Cc: Kalle Valo, David S. Miller, linux-wireless, netdev, LKML,
	clang-built-linux

On Fri, Jun 14, 2019 at 1:54 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
> 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 []`.

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.
-- 
Thanks,
~Nick Desaulniers

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

* Re: [PATCH] wl18xx: Fix Wunused-const-variable
  2019-06-14 20:54 ` Nick Desaulniers
  2019-06-14 20:57   ` Nick Desaulniers
@ 2019-06-17  7:44   ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-06-17  7:44 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Nathan Huckleberry, eliad, arik, David S. Miller, linux-wireless,
	netdev, LKML, clang-built-linux

Nick Desaulniers <ndesaulniers@google.com> writes:

> On Fri, Jun 14, 2019 at 10:17 AM 'Nathan Huckleberry' via Clang Built
> Linux <clang-built-linux@googlegroups.com> wrote:
>>
>> 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.
>
> 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 <ndesaulniers@google.com>
>
> 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.

-- 
Kalle Valo

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

* Re: [PATCH] wl18xx: Fix Wunused-const-variable
  2019-06-14 17:17 [PATCH] wl18xx: Fix Wunused-const-variable Nathan Huckleberry
  2019-06-14 20:54 ` Nick Desaulniers
@ 2019-06-24 13:22 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-06-24 13:22 UTC (permalink / raw)
  To: Nathan Huckleberry
  Cc: davem, linux-wireless, netdev, linux-kernel, Nathan Huckleberry,
	clang-built-linux

Nathan Huckleberry <nhuck@google.com> wrote:

> 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.
> 
> Cc: clang-built-linux@googlegroups.com
> Link: https://github.com/ClangBuiltLinux/linux/issues/530
> Signed-off-by: Nathan Huckleberry <nhuck@google.com>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Patch applied to wireless-drivers.git, thanks.

608fd7214323 wl18xx: Fix Wunused-const-variable

-- 
https://patchwork.kernel.org/patch/10996073/

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


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

end of thread, other threads:[~2019-06-24 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-14 17:17 [PATCH] wl18xx: Fix Wunused-const-variable Nathan Huckleberry
2019-06-14 20:54 ` Nick Desaulniers
2019-06-14 20:57   ` Nick Desaulniers
2019-06-17  7:44   ` Kalle Valo
2019-06-24 13:22 ` 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).