Re: [PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function

2020-08-31 Thread Kalle Valo
Lee Jones  wrote:

> 'ar9170_qmap' is used in some source files which include carl9170.h,
> but not all of them.  A 'defined but not used' warning is thrown when
> compiling the ones which do not use it.
> 
> Fixes the following W=1 kernel build warning(s)
> 
>  from drivers/net/wireless/ath/carl9170/carl9170.h:57,
>  In file included from drivers/net/wireless/ath/carl9170/carl9170.h:57,
>  drivers/net/wireless/ath/carl9170/carl9170.h:71:17: warning: ‘ar9170_qmap’ 
> defined but not used [-Wunused-const-variable=]
> 
>  NB: Snipped - lots of these repeat
> 
> Cc: Christian Lamparter 
> Cc: Kalle Valo 
> Cc: "David S. Miller" 
> Cc: Jakub Kicinski 
> Cc: Johannes Berg 
> Cc: linux-wirel...@vger.kernel.org
> Cc: net...@vger.kernel.org
> Suggested-by: Rasmus Villemoes 
> Signed-off-by: Lee Jones 
> Acked-by: Christian Lamparter 
> Signed-off-by: Kalle Valo 

Patch applied to ath-next branch of ath.git, thanks.

859228a3ae82 carl9170: Convert 'ar9170_qmap' to inline function

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

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



Re: [PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function

2020-08-31 Thread Kalle Valo
Christian Lamparter  writes:

> On Thursday, 27 August 2020 11:33:51 CEST Lee Jones wrote:
>> 'ar9170_qmap' is used in some source files which include carl9170.h,
>> but not all of them.  A 'defined but not used' warning is thrown when
>> compiling the ones which do not use it.
>> 
>> Fixes the following W=1 kernel build warning(s)
>> 
>>  from drivers/net/wireless/ath/carl9170/carl9170.h:57,
>>  In file included from drivers/net/wireless/ath/carl9170/carl9170.h:57,
>>  drivers/net/wireless/ath/carl9170/carl9170.h:71:17: warning:
>> ‘ar9170_qmap’ defined but not used [-Wunused-const-variable=]
>> 
>>  NB: Snipped - lots of these repeat
>> 
>> Cc: Christian Lamparter 
>> Cc: Kalle Valo 
>> Cc: "David S. Miller" 
>> Cc: Jakub Kicinski 
>> Cc: Johannes Berg 
>> Cc: linux-wirel...@vger.kernel.org
>> Cc: net...@vger.kernel.org
>> Suggested-by: Rasmus Villemoes 
>> Signed-off-by: Lee Jones 
>> ---
>
> For what it's worth:
> Acked-by: Christian Lamparter 

BTW for me Acked-by tags from the maintainer are very useful. Patchwork
even collects them automatically and shows the statistics so I can
quickly see what patches are ready to be applied. So please do send them
if you can :)

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


Re: [PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function

2020-08-28 Thread Christian Lamparter
On Thursday, 27 August 2020 11:33:51 CEST Lee Jones wrote:
> 'ar9170_qmap' is used in some source files which include carl9170.h,
> but not all of them.  A 'defined but not used' warning is thrown when
> compiling the ones which do not use it.
> 
> Fixes the following W=1 kernel build warning(s)
> 
>  from drivers/net/wireless/ath/carl9170/carl9170.h:57,
>  In file included from drivers/net/wireless/ath/carl9170/carl9170.h:57,
>  drivers/net/wireless/ath/carl9170/carl9170.h:71:17: warning: ‘ar9170_qmap’ 
> defined but not used [-Wunused-const-variable=]
> 
>  NB: Snipped - lots of these repeat
> 
> Cc: Christian Lamparter 
> Cc: Kalle Valo 
> Cc: "David S. Miller" 
> Cc: Jakub Kicinski 
> Cc: Johannes Berg 
> Cc: linux-wirel...@vger.kernel.org
> Cc: net...@vger.kernel.org
> Suggested-by: Rasmus Villemoes 
> Signed-off-by: Lee Jones 
> ---

For what it's worth:
Acked-by: Christian Lamparter 





[PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function

2020-08-27 Thread Lee Jones
'ar9170_qmap' is used in some source files which include carl9170.h,
but not all of them.  A 'defined but not used' warning is thrown when
compiling the ones which do not use it.

Fixes the following W=1 kernel build warning(s)

 from drivers/net/wireless/ath/carl9170/carl9170.h:57,
 In file included from drivers/net/wireless/ath/carl9170/carl9170.h:57,
 drivers/net/wireless/ath/carl9170/carl9170.h:71:17: warning: ‘ar9170_qmap’ 
defined but not used [-Wunused-const-variable=]

 NB: Snipped - lots of these repeat

Cc: Christian Lamparter 
Cc: Kalle Valo 
Cc: "David S. Miller" 
Cc: Jakub Kicinski 
Cc: Johannes Berg 
Cc: linux-wirel...@vger.kernel.org
Cc: net...@vger.kernel.org
Suggested-by: Rasmus Villemoes 
Signed-off-by: Lee Jones 
---
 drivers/net/wireless/ath/carl9170/carl9170.h | 5 -
 drivers/net/wireless/ath/carl9170/main.c | 2 +-
 drivers/net/wireless/ath/carl9170/tx.c   | 6 +++---
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h 
b/drivers/net/wireless/ath/carl9170/carl9170.h
index 237d0cda1bcb0..0d38100d6e4f5 100644
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -68,7 +68,10 @@
 
 #define PAYLOAD_MAX(CARL9170_MAX_CMD_LEN / 4 - 1)
 
-static const u8 ar9170_qmap[__AR9170_NUM_TXQ] = { 3, 2, 1, 0 };
+static inline u8 ar9170_qmap(u8 idx)
+{
+   return 3 - idx; /* { 3, 2, 1, 0 } */
+}
 
 #define CARL9170_MAX_RX_BUFFER_SIZE8192
 
diff --git a/drivers/net/wireless/ath/carl9170/main.c 
b/drivers/net/wireless/ath/carl9170/main.c
index 816929fb5b143..dbef9d8fc893b 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1374,7 +1374,7 @@ static int carl9170_op_conf_tx(struct ieee80211_hw *hw,
int ret;
 
mutex_lock(>mutex);
-   memcpy(>edcf[ar9170_qmap[queue]], param, sizeof(*param));
+   memcpy(>edcf[ar9170_qmap(queue)], param, sizeof(*param));
ret = carl9170_set_qos(ar);
mutex_unlock(>mutex);
return ret;
diff --git a/drivers/net/wireless/ath/carl9170/tx.c 
b/drivers/net/wireless/ath/carl9170/tx.c
index 2407931440edb..2f9e275db8ef0 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -663,7 +663,7 @@ static void __carl9170_tx_process_status(struct ar9170 *ar,
unsigned int r, t, q;
bool success = true;
 
-   q = ar9170_qmap[info & CARL9170_TX_STATUS_QUEUE];
+   q = ar9170_qmap(info & CARL9170_TX_STATUS_QUEUE);
 
skb = carl9170_get_queued_skb(ar, cookie, >tx_status[q]);
if (!skb) {
@@ -979,7 +979,7 @@ static int carl9170_tx_prepare(struct ar9170 *ar,
((CARL9170_TX_SUPER_MISC_VIF_ID >>
 CARL9170_TX_SUPER_MISC_VIF_ID_S) + 1));
 
-   hw_queue = ar9170_qmap[carl9170_get_queue(ar, skb)];
+   hw_queue = ar9170_qmap(carl9170_get_queue(ar, skb));
 
hdr = (void *)skb->data;
info = IEEE80211_SKB_CB(skb);
@@ -1279,7 +1279,7 @@ void carl9170_tx_drop(struct ar9170 *ar, struct sk_buff 
*skb)
 
super = (void *)skb->data;
SET_VAL(CARL9170_TX_SUPER_MISC_QUEUE, q,
-   ar9170_qmap[carl9170_get_queue(ar, skb)]);
+   ar9170_qmap(carl9170_get_queue(ar, skb)));
__carl9170_tx_process_status(ar, super->s.cookie, q);
 }
 
-- 
2.25.1