Message ID | 20221205085342.677329-1-pkosyh@yandex.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2140063wrr; Mon, 5 Dec 2022 01:04:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf7y3ZHbSdCIlMxdtSiirIcImuu9UZExd6wjvEkP0lpYY0n2Qd4dYdyKOE8SD312vca5yG2r X-Received: by 2002:a17:906:f90:b0:7ba:9c18:11e7 with SMTP id q16-20020a1709060f9000b007ba9c1811e7mr46320287ejj.198.1670231077211; Mon, 05 Dec 2022 01:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670231077; cv=none; d=google.com; s=arc-20160816; b=awODn3Sm2g9ekJZ1BDmG2d5GUS4YycLDfYxOoeoPJwwkbZWZnHa49HG232AeSQ0idj V0opqKz+ul2Q+vF9J0BdHnLQwaKEvOz05I0GjETPAhKbfM/5synQKfA0aEd4r8CUulaG 47VuuiWtw/DManmtSwlHaiAoP+13OLhOJlK+FrwfVzsqI0psevRUcd6x5qmQDzEOl73P 3g3KQWu4k84PahRX571THQJI0YZ2PWCmYRv1LPLzc4fBefK/BreNKTAjx5E9jVHNrm6L u71kKzwlGxYymnInUM7dpdCkYNXbIPyeOW6cfoku2ZL7QW02ZN/I32vtGVOQnf8hguHz 6Cfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nlHUmVYpdftndnegSElvuzQFYDoRyQq2iItNKu1ivvk=; b=lIK8qqx6j9hKP47yzqThcUCACdg8NyLXtmI6W279iQbNNyHA5s9opD5Bgbkc0E/VpK +L/nWPPbcE9EwsQtnI2vQL2h5ubI+dvUVs86uBXmZMxzxOav5ADtH3/pTmtuLK55GDhd 8jq+1OsKhnqqDJkFAr/hrKiO2qkfI0FqCCuDNVuco5Z2H/uWK6wtBSZU1TR175I3tiNE amjNXrKczHhKyYTbUrYmuWG7xudmjOt2GK9aToUuYlZhN08iiB3UpRzASn8xNiZq+R59 kGkPvvKF9cw0fyTxc9hU9W3zkWQyC+7qcj37PZ0ojNF/W5yYT2EbjZOUTghIOTcuCIhX ubVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=gKqBBB63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb40-20020a1709076da800b007bebf105450si12903549ejc.235.2022.12.05.01.04.13; Mon, 05 Dec 2022 01:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=gKqBBB63; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232294AbiLEI41 (ORCPT <rfc822;jaysivo@gmail.com> + 99 others); Mon, 5 Dec 2022 03:56:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232301AbiLEIzt (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Dec 2022 03:55:49 -0500 Received: from forward105j.mail.yandex.net (forward105j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::108]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3827B876 for <linux-kernel@vger.kernel.org>; Mon, 5 Dec 2022 00:54:44 -0800 (PST) Received: from myt6-bd59def10a3e.qloud-c.yandex.net (myt6-bd59def10a3e.qloud-c.yandex.net [IPv6:2a02:6b8:c12:2487:0:640:bd59:def1]) by forward105j.mail.yandex.net (Yandex) with ESMTP id 6B5204ECA42D; Mon, 5 Dec 2022 11:53:48 +0300 (MSK) Received: by myt6-bd59def10a3e.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id hrRE5NnYLGk1-jjaJR5Oi; Mon, 05 Dec 2022 11:53:47 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1670230427; bh=nlHUmVYpdftndnegSElvuzQFYDoRyQq2iItNKu1ivvk=; h=Message-Id:Date:Cc:Subject:To:From; b=gKqBBB63dzgbuvZ/QR3Kl0SILSBrpIp/v4Z2BgpD9dtEXRleuFo893iPsY2DYSKdZ bRSRu9NjS/KSl/Qjwk3ZK9Ys9/HSuK/jLPLSneX+vn26L+thpCFlUOYafomEmEjFnj e1eKxRk/mXiXOHotxWwuk2ZTvLuqE52gwCrrii7c= Authentication-Results: myt6-bd59def10a3e.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru From: Peter Kosyh <pkosyh@yandex.ru> To: Ping-Ke Shih <pkshih@realtek.com> Cc: Peter Kosyh <pkosyh@yandex.ru>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Kalle Valo <kvalo@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: [PATCH] rtlwifi: rtl8192se: remove redundant rtl_get_bbreg call Date: Mon, 5 Dec 2022 11:53:42 +0300 Message-Id: <20221205085342.677329-1-pkosyh@yandex.ru> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751364221964296042?= X-GMAIL-MSGID: =?utf-8?q?1751364221964296042?= |
Series |
rtlwifi: rtl8192se: remove redundant rtl_get_bbreg call
|
|
Commit Message
Peter Kosyh
Dec. 5, 2022, 8:53 a.m. UTC
Extra rtl_get_bbreg looks like redundant reading. The read has
already been done in the "else" branch. Compile test only.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Peter Kosyh <pkosyh@yandex.ru>
---
If this code is important for the operation of the hardware, then it would
be nice to comment on it.
drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 3 ---
1 file changed, 3 deletions(-)
Comments
> -----Original Message----- > From: Peter Kosyh <pkosyh@yandex.ru> > Sent: Monday, December 5, 2022 4:54 PM > To: Ping-Ke Shih <pkshih@realtek.com> > Cc: Peter Kosyh <pkosyh@yandex.ru>; David S. Miller <davem@davemloft.net>; Eric Dumazet > <edumazet@google.com>; Kalle Valo <kvalo@kernel.org>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni > <pabeni@redhat.com>; linux-wireless@vger.kernel.org; netdev@vger.kernel.org; > linux-kernel@vger.kernel.org; lvc-project@linuxtesting.org > Subject: [PATCH] rtlwifi: rtl8192se: remove redundant rtl_get_bbreg call > > Extra rtl_get_bbreg looks like redundant reading. The read has > already been done in the "else" branch. Compile test only. Originally, the code is 01 if (rfpi_enable) 02 val = get_from_interface_A(); 03 else 04 val = get_from_interface_B(); 05 06 val = get_from_interface_B(); This patch is to remove line 06, and it looks like logic is changed. However, 'rfpi_enable' is decided by 0x820[8] and 0x828[8] set by rtl8192sephy_reg_2t2rarray[] table, and 'rfpi_enable' is always false. I think this is why nobody can't encounter problem and find this bug. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Peter Kosyh <pkosyh@yandex.ru> Acked-by: Ping-Ke Shih <pkshih@realtek.com> > --- > If this code is important for the operation of the hardware, then it would > be nice to comment on it. > > drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c > b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c > index aaa004d4d6d0..09591a0b5a81 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c > @@ -115,9 +115,6 @@ static u32 _rtl92s_phy_rf_serial_read(struct ieee80211_hw *hw, > retvalue = rtl_get_bbreg(hw, pphyreg->rf_rb, > BLSSI_READBACK_DATA); > > - retvalue = rtl_get_bbreg(hw, pphyreg->rf_rb, > - BLSSI_READBACK_DATA); > - > rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE, "RFR-%d Addr[0x%x]=0x%x\n", > rfpath, pphyreg->rf_rb, retvalue); > > -- > 2.38.1
Peter Kosyh <pkosyh@yandex.ru> wrote: > Extra rtl_get_bbreg() call looks like redundant reading. The read has > already been done in the "else" branch. Compile test only. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Peter Kosyh <pkosyh@yandex.ru> > Acked-by: Ping-Ke Shih <pkshih@realtek.com> Patch applied to wireless-next.git, thanks. 49ebca0d9018 wifi: rtlwifi: rtl8192se: remove redundant rtl_get_bbreg() call
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c index aaa004d4d6d0..09591a0b5a81 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c @@ -115,9 +115,6 @@ static u32 _rtl92s_phy_rf_serial_read(struct ieee80211_hw *hw, retvalue = rtl_get_bbreg(hw, pphyreg->rf_rb, BLSSI_READBACK_DATA); - retvalue = rtl_get_bbreg(hw, pphyreg->rf_rb, - BLSSI_READBACK_DATA); - rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE, "RFR-%d Addr[0x%x]=0x%x\n", rfpath, pphyreg->rf_rb, retvalue);