linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: davem@davemloft.net, kuba@kernel.org
Cc: linux-kernel@vger.kernel.org,
	Christian Lamparter <chunkeey@googlemail.com>,
	Kalle Valo <kvalo@codeaurora.org>,
	Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function
Date: Thu, 27 Aug 2020 10:33:51 +0100	[thread overview]
Message-ID: <20200827093351.GA1627017@dell> (raw)
In-Reply-To: <20200814113933.1903438-9-lee.jones@linaro.org>

'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 <chunkeey@googlemail.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 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_SIZE		8192
 
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(&ar->mutex);
-	memcpy(&ar->edcf[ar9170_qmap[queue]], param, sizeof(*param));
+	memcpy(&ar->edcf[ar9170_qmap(queue)], param, sizeof(*param));
 	ret = carl9170_set_qos(ar);
 	mutex_unlock(&ar->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, &ar->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

  parent reply	other threads:[~2020-08-27  9:34 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200814113933.1903438-1-lee.jones@linaro.org>
2020-08-14 11:39 ` [PATCH 05/30] net: wireless: atmel: atmel: Demote non-kerneldoc header to standard comment block Lee Jones
2020-08-27 12:16   ` [PATCH 05/30] " Kalle Valo
2020-08-14 11:39 ` [PATCH 07/30] net: wireless: broadcom: b43: main: Add braces around empty statements Lee Jones
2020-08-14 15:12   ` Kalle Valo
2020-08-14 16:43     ` Lee Jones
2020-08-14 17:25       ` Kalle Valo
2020-08-17  8:50         ` Lee Jones
2020-08-27  7:42           ` Kalle Valo
2020-08-27  8:49             ` Lee Jones
2020-08-14 11:39 ` [PATCH 08/30] net: wireless: ath: carl9170: Mark 'ar9170_qmap' as __maybe_unused Lee Jones
2020-08-14 15:14   ` Christian Lamparter
2020-08-14 16:40     ` Lee Jones
2020-08-14 17:25       ` Christian Lamparter
2020-08-17  8:43         ` Lee Jones
2020-08-17  8:26     ` Rasmus Villemoes
2020-08-17 12:59       ` Kalle Valo
2020-08-17 18:29         ` Christian Lamparter
2020-08-18  9:50         ` Lee Jones
2020-08-27  7:54           ` Kalle Valo
2020-08-27  9:33   ` Lee Jones [this message]
2020-08-28 20:28     ` [PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function Christian Lamparter
2020-08-31 13:56       ` Kalle Valo
2020-08-31 15:19     ` Kalle Valo
2020-08-14 11:39 ` [PATCH 09/30] net: wireless: ath: ath5k: pcu: Add a description for 'band' remove one for 'mode' Lee Jones
2020-08-17 10:20   ` Kalle Valo
2020-08-14 11:39 ` [PATCH 11/30] net: wireless: cisco: airo: Place brackets around empty statement Lee Jones
2020-08-14 11:39 ` [PATCH 12/30] net: wireless: cisco: airo: Fix a myriad of coding style issues Lee Jones
2020-08-14 15:15   ` Kalle Valo
2020-08-14 16:38     ` Lee Jones
2020-08-17 13:27       ` Kalle Valo
2020-08-17 18:27         ` Jesse Brandeburg
2020-08-17 20:04           ` Lee Jones
2020-08-17 21:35           ` Ondrej Zary
2020-08-27  7:49             ` Kalle Valo
2020-08-27 20:23               ` Ondrej Zary
2020-08-28  8:59                 ` Kalle Valo
2020-08-28 10:08                   ` Lee Jones
2020-08-28 12:37                     ` Kalle Valo
2020-08-28 21:34                   ` Ondrej Zary
2020-08-14 11:39 ` [PATCH 13/30] net: wireless: ath: wil6210: cfg80211: Demote non-kerneldoc headers to standard comment blocks Lee Jones
2020-08-14 11:39 ` [PATCH 14/30] net: wireless: intel: iwlegacy: common: Remove set but not used variable 'len' Lee Jones
2020-08-14 11:39 ` [PATCH 15/30] net: wireless: intel: iwlegacy: common: Demote kerneldoc headers to standard comment blocks Lee Jones
2020-08-14 11:39 ` [PATCH 16/30] net: wireless: intel: ipw2200: Remove set but unused variables 'rc' and 'w' Lee Jones
2020-08-14 11:39 ` [PATCH 17/30] net: wireless: broadcom: b43legacy: main: Provide braces around empty 'if' body Lee Jones
2020-08-14 11:39 ` [PATCH 20/30] net: wireless: ath: ath5k: base: Fix kerneldoc formatting issue Lee Jones
2020-08-14 11:39 ` [PATCH 22/30] net: wireless: broadcom: brcm80211: brcmfmac: fweh: Remove set but unused variable 'err' Lee Jones
2020-08-14 11:39 ` [PATCH 23/30] net: wireless: broadcom: brcm80211: brcmfmac: fweh: Fix docrot related function documentation issues Lee Jones
2020-08-14 11:39 ` [PATCH 24/30] net: wireless: broadcom: brcm80211: brcmsmac: mac80211_if: Demote a few non-conformant kerneldoc headers Lee Jones
2020-08-14 11:39 ` [PATCH 25/30] net: wireless: intel: ipw2x00: ipw2200: Demote lots of nonconformant kerneldoc comments Lee Jones
2020-08-14 11:39 ` [PATCH 26/30] net: wireless: broadcom: b43: phy_common: Demote non-conformant kerneldoc header Lee Jones
     [not found]   ` <CAJrvBf00yQQ7F1p1utBuq1oWc2RwnqXijBjaJ+FuxG0mS0TvOA@mail.gmail.com>
2020-08-14 16:36     ` Lee Jones
2020-08-17  8:06   ` Rafał Miłecki
2020-08-17  9:11     ` Lee Jones
2020-08-14 11:39 ` [PATCH 30/30] net: wireless: broadcom: b43: phy_n: Add empty braces around empty statements Lee Jones
     [not found] ` <87eeo88pdr.fsf@tynnyri.adurom.net>
2020-08-17  8:16   ` [PATCH 00/30] Rid W=1 warnings in Networking Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200827093351.GA1627017@dell \
    --to=lee.jones@linaro.org \
    --cc=chunkeey@googlemail.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).