Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp297255pxa; Thu, 27 Aug 2020 02:35:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxNBYgg7LNMCT8UxTho8OtTGhrqmUtC2atQBk9SPBXw6OnPPXMXqUAEYZv9H6Jn9NnusCy X-Received: by 2002:a17:906:560a:: with SMTP id f10mr14751386ejq.35.1598520922571; Thu, 27 Aug 2020 02:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598520922; cv=none; d=google.com; s=arc-20160816; b=U9MnVnAlsHh2JDFY3R1NvlP4rg1N/naBDMnHD+l+zu2s4TyGtWZDDUc1owldGmlYXd /wk+zvVMUCxO+SO/x3w4l0UvwdUg/nTiPonQs4ucFFKnlzeK0MBokAtBPva8LsK7HWFA w8perv1APEl3tdqyCv5ZcKSIHWOYA/p3amChk/bapxpDhag2GMuxirjLl8vHLz1A62Tq m2BEUUWmFBpkl74sw3QJvIaOVQsKb/mCf+74hJGxzOBnbpsKL9mffleqoSfz32ndRnlY NCQR0DxyuMJBf2qnO0EhDGQWifdDJXq+I4kBHEqk1Xds2JV3Udqreick5/1XktzcVaTX zXCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=s5e7PAlfYft9eFvmMXp+FriUBHbpOi2nhrqdvKXRL50=; b=jD35Ywv+NRRJuuEhjSQXFM2ZHayVAn6Ad8WP/nH5pYVaPegW8QLgYk72qCMQzaex8o o1XT+jZuInZgJO1wKiUp5/VC9tS1JuPNvfEj1OaDarCMp3G8vAOwNK+TRvLjIuLYHO5R pKKDV7Z0pI0LWjH6Lwb95ZlRn9u+uVcAV7GoPANN/YMDn+XKlf1yMOu/LFQ9rZfSNSy1 5PBBIRBjgFOYe8LBNPPdePclrurRTwaL5mohA7vJMAfzi2lE+kJ1PrS/pbA+N8jdDeC3 oJgJUpo2zn7Ooon2gNsdO5Z8MqpKSh+yKviwC7ncDXDeJaDAQ45wf4MyJuq31XHH3Gc+ wgOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dYuJGVBm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t21si922599ejs.708.2020.08.27.02.34.58; Thu, 27 Aug 2020 02:35:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dYuJGVBm; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728453AbgH0Jd6 (ORCPT + 99 others); Thu, 27 Aug 2020 05:33:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728185AbgH0Jdz (ORCPT ); Thu, 27 Aug 2020 05:33:55 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD18FC061264 for ; Thu, 27 Aug 2020 02:33:54 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id w2so4297604wmi.1 for ; Thu, 27 Aug 2020 02:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=s5e7PAlfYft9eFvmMXp+FriUBHbpOi2nhrqdvKXRL50=; b=dYuJGVBmRmkmXcoI/V4nntaTYx0qVN96dznRjB5R99zgjt5H9u2l2suAYGkf2qk4ZR RsUF2Uz5WhB1nfeZXqMidyIy+q4T6fVEwGcLaNB7Edoeha/7YEeM556KKBTSV7eMXuF6 Krva4Tp7eXmq2Cq1coYzDJCPsBvSCoExnMmb9DadVQY0ADbqBnoxz76CmueCHXwuB7t4 Cdmlpq2WBEN0fGM0Fm6nsxVeLbqMvPqR4JDzUDNUhB+b0NtYmhMq53ROTjzCpejkw+k1 aJnVc9hay1VHePkWxNQApXCtZt9Ofh0sgfBQdtvsahoiWizIFVfTK+5W285a/FFH27hv MTPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=s5e7PAlfYft9eFvmMXp+FriUBHbpOi2nhrqdvKXRL50=; b=QqmtOafdR227Aa+1svoLeE39IZqOnQRqbj88IFKIjRLAj6lcMPZndS5ykSsOubadGw haZlX3W+qSutCkn4s24HGQEw8hvhjml0RPAKX8ulmqIWBeIkaKvLJF5D99BlfQAinTxb mAO8CUHUovV8IdZwr1m85I4QzArpMRXR7UNBENqDDiS3pXsIM5A4NQDXtUgVG0gkyNYc 96YWUOUPTziM3aZnnimTF2DwBZULCynAhoqMxLgj4vIDqLbB3XtWf6HQr5OPLNdiHMg8 p4Vl2pL4EXHQAvOZ/mr+Hi5ln0EV9ph4ORTEfQTdlKtp1YJ5I/FpF/Y0pEB2BoTrx+tG WJpw== X-Gm-Message-State: AOAM5322AVulAEO+TyJKhPefJACUJRii9GVDHZdzHOeC2ppa1Bai9ock R2Us9w1GCp8+1l89NOilwfOJKQ== X-Received: by 2002:a1c:f00a:: with SMTP id a10mr10797514wmb.84.1598520833319; Thu, 27 Aug 2020 02:33:53 -0700 (PDT) Received: from dell ([91.110.221.141]) by smtp.gmail.com with ESMTPSA id z8sm3879309wmf.42.2020.08.27.02.33.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 02:33:52 -0700 (PDT) Date: Thu, 27 Aug 2020 10:33:51 +0100 From: Lee Jones To: davem@davemloft.net, kuba@kernel.org Cc: linux-kernel@vger.kernel.org, Christian Lamparter , Kalle Valo , Johannes Berg , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 08/30] net: wireless: ath: carl9170: Convert 'ar9170_qmap' to inline function Message-ID: <20200827093351.GA1627017@dell> References: <20200814113933.1903438-1-lee.jones@linaro.org> <20200814113933.1903438-9-lee.jones@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200814113933.1903438-9-lee.jones@linaro.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 Cc: Kalle Valo Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Johannes Berg Cc: linux-wireless@vger.kernel.org Cc: netdev@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_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