From patchwork Sat Jul 31 12:40:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 490061 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCE75C432BE for ; Sat, 31 Jul 2021 12:40:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AFD066052B for ; Sat, 31 Jul 2021 12:40:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232957AbhGaMk5 (ORCPT ); Sat, 31 Jul 2021 08:40:57 -0400 Received: from smtp-relay-canonical-1.canonical.com ([185.125.188.121]:39810 "EHLO smtp-relay-canonical-1.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232690AbhGaMk4 (ORCPT ); Sat, 31 Jul 2021 08:40:56 -0400 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 572F73F0FD; Sat, 31 Jul 2021 12:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627735249; bh=oUq6gPgdLVraYDRbQRFMm2OILuIbppCsvEd0SKiqGuE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=Qa+aNlMgECRGFRqmuzEkdbaBsr2JR/J5l8wJ3pc+dtD11jqap5mt9b/P7TC/4xXBl 0OEPEBnnFhiTkNqBhauRBAWPTzvHYhb95qg4/+PS3AVrxOX05hqx3pI4K8mBvY4zCb kn4i/AJxg0sOZNjwc1c6W2Vq6jIfL+C1VBWK1eFDsqbS02RvJeOFJIE6GZ1LbYn8Wa Q/ofzr1RCPDMixYNcaDUvV3qq820sBk+whGGKu5wSxar+zI4lZHJxPxVeo9qPN4x/E Hx/+1FrTEAudD/eKN/0/kfIn49m/7GVUPtpqwBKufJTEKL2/tnfjp21eaFR2OxyG5W BhTPlHcd3UGyg== From: Colin King To: Ping-Ke Shih , Kalle Valo , "David S . Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] rtlwifi: rtl8192de: Remove redundant variable initializations Date: Sat, 31 Jul 2021 13:40:43 +0100 Message-Id: <20210731124044.101927-1-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Colin Ian King The variables rtstatus and place are being initialized with a values that are never read, the initializations are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King Acked-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c index 76dd881ef9bb..4eaa40d73baf 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c @@ -681,7 +681,7 @@ static bool _rtl92d_phy_bb_config(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); - bool rtstatus = true; + bool rtstatus; rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, "==>\n"); rtstatus = _rtl92d_phy_config_bb_with_headerfile(hw, @@ -1362,7 +1362,7 @@ u8 rtl92d_get_rightchnlplace_for_iqk(u8 chnl) 132, 134, 136, 138, 140, 149, 151, 153, 155, 157, 159, 161, 163, 165 }; - u8 place = chnl; + u8 place; if (chnl > 14) { for (place = 14; place < sizeof(channel_all); place++) { From patchwork Sat Jul 31 12:40:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 490258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50D0DC43214 for ; Sat, 31 Jul 2021 12:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 21A7B60F48 for ; Sat, 31 Jul 2021 12:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233090AbhGaMk6 (ORCPT ); Sat, 31 Jul 2021 08:40:58 -0400 Received: from smtp-relay-canonical-0.canonical.com ([185.125.188.120]:55296 "EHLO smtp-relay-canonical-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232692AbhGaMk5 (ORCPT ); Sat, 31 Jul 2021 08:40:57 -0400 Received: from localhost (1.general.cking.uk.vpn [10.172.193.212]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 753DA3F0A8; Sat, 31 Jul 2021 12:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1627735249; bh=WmppQV2MYziB7/h7Q9+1v9o0+Fs4+5hGMgdCIXdYWlE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=wBgNYQm0hDv5l3lbaflmQrk2gx4/xLXmvgoKToO/EQ2eXXfXsFsqJO+9k/xFAgK5Y OXli37WVFc1ew44JhiLeGwTCLezOOaZgJ1U7/jYBCuhXQ8pqOpvo7nPF0zKwPtiN+b SwPuvFk258yapl4rqqJ8BjaTtZi/c4lRMtsZD49tXm0xO3UMxF4AsZHWU/TPxCwNIR dT1nd2YBlzDuXk43T7esgwymw6zrViog60XHzkKYovAwX/yWQEG6QcToXSZmJSyrA2 gzMSS03Zl4LtmN1ZKsjlHtiafiZ1rBROa12etRyfQgWgYGe6VMRM2WKPN80F2rQPxB W2Gz31QLcJW6Q== From: Colin King To: Ping-Ke Shih , Kalle Valo , "David S . Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] rtlwifi: rtl8192de: make arrays static const, makes object smaller Date: Sat, 31 Jul 2021 13:40:44 +0100 Message-Id: <20210731124044.101927-2-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210731124044.101927-1-colin.king@canonical.com> References: <20210731124044.101927-1-colin.king@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Colin Ian King Don't populate arrays the stack but instead make them static const Makes the object code smaller by 852 bytes. Before: text data bss dec hex filename 128211 44250 1024 173485 2a5ad ../realtek/rtlwifi/rtl8192de/phy.o After: text data bss dec hex filename 127199 44410 1024 172633 2a259 ../realtek/rtlwifi/rtl8192de/phy.o (gcc version 10.2.0) Signed-off-by: Colin Ian King Acked-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c index 4eaa40d73baf..79956254f798 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c @@ -1354,7 +1354,7 @@ static void _rtl92d_phy_switch_rf_setting(struct ieee80211_hw *hw, u8 channel) u8 rtl92d_get_rightchnlplace_for_iqk(u8 chnl) { - u8 channel_all[59] = { + static const u8 channel_all[59] = { 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, @@ -3220,7 +3220,7 @@ void rtl92d_phy_config_macphymode_info(struct ieee80211_hw *hw) u8 rtl92d_get_chnlgroup_fromarray(u8 chnl) { u8 group; - u8 channel_info[59] = { + static const u8 channel_info[59] = { 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,