Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1214877lqd; Thu, 25 Apr 2024 08:57:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4YRD1fUpx0zQqHPer6Zmj0o9ur35D/nkuJk4KqqAU2YskJhpg1iUzmxvtDe099FqXyNim+QcPSq69mzfkRbSRquCRw3V8QlFlqOCC5A== X-Google-Smtp-Source: AGHT+IEgbEWUZhB/bpgSF5ryvPdbE/7bU/xR8ZszWRPY6ANB1KNRVHvfCym+eoFjho6nVApLOiWX X-Received: by 2002:a50:d792:0:b0:56e:2c34:cff2 with SMTP id w18-20020a50d792000000b0056e2c34cff2mr126408edi.19.1714060664342; Thu, 25 Apr 2024 08:57:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714060664; cv=pass; d=google.com; s=arc-20160816; b=TJSA7wdUeAFMegZwgLwBm3vJa9XTunZyXqCy9eukxf7uLuQDYjWK6Q3rFEQ/MVzjsm 3BqT2n9dzKbouwwYbdWgM/W+ng+0YrI29RV/lVSoWzHTk3qZRHSVHpQ97MkPhC3/ci0V vjs6Juto2kQFTa8vEGp9cG1Gp3t0nv6CgBsLtEPceQ7XLI6ilMkwnz/BxBUYU5JMoC86 wo4ZXVWBA+elT+DzP3yG3//S0QS06/zlbUcbS4IXvyxv4W/xKIdJ7Yh6FK2lw3dfIW5t i19sXIvggWK1cZLIh6Sfi3WH1SvfIea1Z3okLf4XPB57WJ8j7pPYevl+3qrNWHHvW2S8 d6Vw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=ZWIDlM3skqmviOGyQzKHYQKwZg26rYhvxBIOzuWaC4M=; fh=iBHY2jrjwcI2IeZ9UhIPSjjoHrGb7PVqwt5BBTqAnbA=; b=rBETGRdJu/cJrC+cS84+Q5x35BW8ONArnpXUQjd7JU5VFHVIUx+tfEOG2RQHw/Du4G Prx/E5jT1WWhGoBrKYxc40bBkZ39SRLLCegR2vubv8Z21He9XaszrN+Cry1x/GubE/Tk KOkBY2Y+8AaVOHt8iX5nA1Ct58TFM36HK2OIyV/5qG+MxEBgIIVqI9IuKbRHhY2wtEi3 xOaTWSPoK2QnvcOn8Ag29xQEd7sqTgjCsloNDBFYFmiFgASKzDtjCvDvNty0ehSeFdnH 0xVqU4Wh3GRb254LGGu+J0lncPJnbjD5h7p5dFmoRFGkh/prrqR7r6mzlighG1X61GMc x7Ww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SHNmKsX9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-6851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id dz12-20020a0564021d4c00b00572309d0676si2402546edb.656.2024.04.25.08.57.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-6851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=SHNmKsX9; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-wireless+bounces-6851-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-6851-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 16C721F2180E for ; Thu, 25 Apr 2024 15:57:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3302514BF9B; Thu, 25 Apr 2024 15:57:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SHNmKsX9" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89E6414B08F; Thu, 25 Apr 2024 15:57:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714060658; cv=none; b=uSti427uWI62Z+KI0DUWUbX3k1uW7drzb7pQ+Q+qsYIgVMLqGXG/hP9AFupIxn4rQjCIuGhj95FeGzvp7dCls24tV7KDFK+/eQlSoVHq1uWzwFMcKi4NKgHpc8h/HIRn14oLBW0+gTgWnp5L/f/9a/KingVCMihiis7kuy+xihw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714060658; c=relaxed/simple; bh=xp/u9E8lqrYHDy7ZttytiOWmxGZSKR2QflsGnvBD7Zw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=kJgvnZ+un7ilRIMCybde1Fr++mpW2i1h05SRERDZq2f+e/rPeR082ltMpuRkXbJEWYLvXDme6gEVKKJZfIYUodi9y+xix+IfHcWC5O/j/41+tDOeu5QbViHQw3YR37RpQn8yQDdjud+zzJO52tOMzY5RK5MB+J9GZF84oRPbK60= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SHNmKsX9; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-41adf3580dbso7250365e9.0; Thu, 25 Apr 2024 08:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714060655; x=1714665455; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZWIDlM3skqmviOGyQzKHYQKwZg26rYhvxBIOzuWaC4M=; b=SHNmKsX9c3ju/PD0NAuXt0MnYhuuqqwybxyzYgPlN3/EdhSeO1xHqIqmW1TADMIiqK PidPDi3lotkECfBh8BSWfbQXYdG9RqaTDRsnCisMnZVsxAu51haQQ0pjFpmy3pQtON/e XS2XMx6eHexSQfQT+251lTfWy6RCCAq7tOkZJTZq7qwtC25k6yoQYGg9pfCc17FluD6Y BSRGVtOyAy9XlvUJttf/AGvQUlnoyxbscP/PZVHIEj+rvXR7H2F0UyBDpT8sOWo7CZB0 wpqYN0sFU79LDHyVheKvvPtI+wLwgz1HIlTwIjexNFGzKNx1bz/cC1rtW9mVAdMnhV2p 7Rmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714060655; x=1714665455; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZWIDlM3skqmviOGyQzKHYQKwZg26rYhvxBIOzuWaC4M=; b=cw7lLXLYo+fdeisqGbM5tWBDhCt57+7poml6Nd58bgqFOprcsFhwKENPznEQrHHcn3 3L4rKet7qA9ekpnjMSw0pkfzl75ldljO1Kw4bqeMi2Mk8YKfWsfiP5jg+QLKdu0jiaXC sn/Cv5J8BhiYYeMbbHopgkKTO2Gf6kbiqfrGq6nsdCYsXM2JD0ZRNMCEl0421M0qr9FP WuzOJq6cM2RsOeHWE/HCMzO/BDe2C/3kJVtmGHv+qo+o+2MkGeU08qjEOt527ChAeOxK OVQC4AjIXM5A7sAnFw6zJATPD3tqAuSwkQu5OIV+J8Dqec4edYIrZAVjuGBfkJPdCq4T G9WA== X-Forwarded-Encrypted: i=1; AJvYcCWhbC1Y8oET0uI/KDwXLvH9uQmiRDZEI9iwW/8obhRvnnTZe2E9NDU234VlujbVzkbrOO8unouCvHmJTY2aTxAxD+q4PeVI0U7uR4rJr0ePBp/NntDM2RxGC6iY1OJ1T5lSjUW8V1CczGRLyDk= X-Gm-Message-State: AOJu0YwegSrMxOsumvuMBJ4fkwXDVh01mIC3VGrmBfnSnAwGqoZwds4D F71TPcRRS7jdlLToa8VATlpj9A0KU5e+g75oVwylqVjvUHyjRRPY X-Received: by 2002:a05:600c:3c9e:b0:41b:34d3:42a5 with SMTP id bg30-20020a05600c3c9e00b0041b34d342a5mr186450wmb.1.1714060654705; Thu, 25 Apr 2024 08:57:34 -0700 (PDT) Received: from localhost (craw-09-b2-v4wan-169726-cust2117.vm24.cable.virginm.net. [92.238.24.70]) by smtp.gmail.com with ESMTPSA id t13-20020a05600c450d00b00417f700eaeasm28159076wmo.22.2024.04.25.08.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:57:34 -0700 (PDT) From: Colin Ian King To: Ping-Ke Shih , Kalle Valo , Su Hui , linux-wireless@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] wifi: rtlwifi: rtl8723be: Make read-only arrays static const Date: Thu, 25 Apr 2024 16:57:33 +0100 Message-Id: <20240425155733.114423-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Don't populate the read-only arrays cck_rates, ofdm_rates, ht_rates_1t and channel_all on the stack at run time, instead make them static const and clean up the formatting. Signed-off-by: Colin Ian King --- .../wireless/realtek/rtlwifi/rtl8723be/phy.c | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c index 094cb36153f5..13e689037acc 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c @@ -1110,16 +1110,22 @@ static void _rtl8723be_phy_set_txpower_index(struct ieee80211_hw *hw, void rtl8723be_phy_set_txpower_level(struct ieee80211_hw *hw, u8 channel) { struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); - u8 cck_rates[] = {DESC92C_RATE1M, DESC92C_RATE2M, - DESC92C_RATE5_5M, DESC92C_RATE11M}; - u8 ofdm_rates[] = {DESC92C_RATE6M, DESC92C_RATE9M, - DESC92C_RATE12M, DESC92C_RATE18M, - DESC92C_RATE24M, DESC92C_RATE36M, - DESC92C_RATE48M, DESC92C_RATE54M}; - u8 ht_rates_1t[] = {DESC92C_RATEMCS0, DESC92C_RATEMCS1, - DESC92C_RATEMCS2, DESC92C_RATEMCS3, - DESC92C_RATEMCS4, DESC92C_RATEMCS5, - DESC92C_RATEMCS6, DESC92C_RATEMCS7}; + static const u8 cck_rates[] = { + DESC92C_RATE1M, DESC92C_RATE2M, + DESC92C_RATE5_5M, DESC92C_RATE11M + }; + static const u8 ofdm_rates[] = { + DESC92C_RATE6M, DESC92C_RATE9M, + DESC92C_RATE12M, DESC92C_RATE18M, + DESC92C_RATE24M, DESC92C_RATE36M, + DESC92C_RATE48M, DESC92C_RATE54M + }; + static const u8 ht_rates_1t[] = { + DESC92C_RATEMCS0, DESC92C_RATEMCS1, + DESC92C_RATEMCS2, DESC92C_RATEMCS3, + DESC92C_RATEMCS4, DESC92C_RATEMCS5, + DESC92C_RATEMCS6, DESC92C_RATEMCS7 + }; u8 i; u8 power_index; @@ -2155,15 +2161,16 @@ static void _rtl8723be_phy_iq_calibrate(struct ieee80211_hw *hw, static u8 _get_right_chnl_place_for_iqk(u8 chnl) { - u8 channel_all[TARGET_CHNL_NUM_2G_5G] = { - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 36, 38, 40, 42, 44, 46, - 48, 50, 52, 54, 56, 58, 60, 62, 64, - 100, 102, 104, 106, 108, 110, - 112, 114, 116, 118, 120, 122, - 124, 126, 128, 130, 132, 134, 136, - 138, 140, 149, 151, 153, 155, 157, - 159, 161, 163, 165}; + static const u8 channel_all[TARGET_CHNL_NUM_2G_5G] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 36, 38, 40, 42, 44, 46, + 48, 50, 52, 54, 56, 58, 60, 62, 64, + 100, 102, 104, 106, 108, 110, + 112, 114, 116, 118, 120, 122, + 124, 126, 128, 130, 132, 134, 136, + 138, 140, 149, 151, 153, 155, 157, + 159, 161, 163, 165 + }; u8 place = chnl; if (chnl > 14) { -- 2.39.2