2023-02-28 02:11:50

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg

Variable bcntime_cfg is not effectively used, so delete it.

drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:6: warning: variable 'bcntime_cfg' set but not used.

Reported-by: Abaci Robot <[email protected]>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4240
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c | 8 --------
1 file changed, 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
index bd0b7e365edb..e1eb9d8203ab 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
@@ -1552,7 +1552,6 @@ void rtl92se_set_beacon_related_registers(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
- u16 bcntime_cfg = 0;
u16 bcn_cw = 6, bcn_ifs = 0xf;
u16 atim_window = 2;

@@ -1576,13 +1575,6 @@ void rtl92se_set_beacon_related_registers(struct ieee80211_hw *hw)
* other ad hoc STA */
rtl_write_byte(rtlpriv, BCN_ERR_THRESH, 100);

- /* Beacon Time Configuration */
- if (mac->opmode == NL80211_IFTYPE_ADHOC)
- bcntime_cfg |= (bcn_cw << BCN_TCFG_CW_SHIFT);
-
- /* TODO: bcn_ifs may required to be changed on ASIC */
- bcntime_cfg |= bcn_ifs << BCN_TCFG_IFS;
-
/*for beacon changed */
rtl92s_phy_set_beacon_hwreg(hw, mac->beacon_interval);
}
--
2.20.1.7.g153144c



2023-02-28 03:51:24

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg

Hi Jiapeng,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on wireless-next/main]
[also build test WARNING on wireless/main]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Jiapeng-Chong/rtlwifi-rtl8192se-Remove-the-unused-variable-bcntime_cfg/20230228-101333
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/r/20230228021132.88910-1-jiapeng.chong%40linux.alibaba.com
patch subject: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20230228/[email protected]/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/c8de031d7e616764eacd615d106a5484bacc675d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Jiapeng-Chong/rtlwifi-rtl8192se-Remove-the-unused-variable-bcntime_cfg/20230228-101333
git checkout c8de031d7e616764eacd615d106a5484bacc675d
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 olddefconfig
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/net/wireless/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>
| Link: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c: In function 'rtl92se_set_beacon_related_registers':
>> drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:25: warning: unused variable 'bcn_ifs' [-Wunused-variable]
1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
| ^~~~~~~
>> drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:13: warning: unused variable 'bcn_cw' [-Wunused-variable]
1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
| ^~~~~~


vim +/bcn_ifs +1555 drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c

24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1550
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1551 void rtl92se_set_beacon_related_registers(struct ieee80211_hw *hw)
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1552 {
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1553 struct rtl_priv *rtlpriv = rtl_priv(hw);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1554 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 @1555 u16 bcn_cw = 6, bcn_ifs = 0xf;
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1556 u16 atim_window = 2;
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1557
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1558 /* ATIM Window (in unit of TU). */
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1559 rtl_write_word(rtlpriv, ATIMWND, atim_window);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1560
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1561 /* Beacon interval (in unit of TU). */
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1562 rtl_write_word(rtlpriv, BCN_INTERVAL, mac->beacon_interval);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1563
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1564 /* DrvErlyInt (in unit of TU). (Time to send
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1565 * interrupt to notify driver to change
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1566 * beacon content) */
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1567 rtl_write_word(rtlpriv, BCN_DRV_EARLY_INT, 10 << 4);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1568
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1569 /* BcnDMATIM(in unit of us). Indicates the
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1570 * time before TBTT to perform beacon queue DMA */
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1571 rtl_write_word(rtlpriv, BCN_DMATIME, 256);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1572
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1573 /* Force beacon frame transmission even
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1574 * after receiving beacon frame from
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1575 * other ad hoc STA */
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1576 rtl_write_byte(rtlpriv, BCN_ERR_THRESH, 100);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1577
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1578 /*for beacon changed */
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1579 rtl92s_phy_set_beacon_hwreg(hw, mac->beacon_interval);
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1580 }
24284531497def drivers/net/wireless/rtlwifi/rtl8192se/hw.c Chaoming Li 2011-05-03 1581

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

2023-02-28 11:07:15

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg

On Tue, Feb 28, 2023 at 10:11:32AM +0800, Jiapeng Chong wrote:
> Variable bcntime_cfg is not effectively used, so delete it.
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:6: warning: variable 'bcntime_cfg' set but not used.
>
> Reported-by: Abaci Robot <[email protected]>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4240
> Signed-off-by: Jiapeng Chong <[email protected]>

Hi Jiapeng Chong,

this looks good to me.

Reviewed-by: Simon Horman <[email protected]>

While reviewing this gcc 12.2.0 told me:

drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:25: error: unused variable 'bcn_ifs' [-Werror=unused-variable]
1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
| ^~~~~~~
drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:13: error: unused variable 'bcn_cw' [-Werror=unused-variable]
1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
| ^~~~~~

So perhaps you could consider sending another patch to remove them too.

2023-03-01 00:33:31

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg



> -----Original Message-----
> From: Simon Horman <[email protected]>
> Sent: Tuesday, February 28, 2023 7:07 PM
> To: Jiapeng Chong <[email protected]>
> Cc: Ping-Ke Shih <[email protected]>; [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; [email protected]; [email protected];
> [email protected]; Abaci Robot <[email protected]>
> Subject: Re: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg
>
> On Tue, Feb 28, 2023 at 10:11:32AM +0800, Jiapeng Chong wrote:
> > Variable bcntime_cfg is not effectively used, so delete it.
> >
> > drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:6: warning: variable 'bcntime_cfg' set but not
> used.
> >
> > Reported-by: Abaci Robot <[email protected]>
> > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4240
> > Signed-off-by: Jiapeng Chong <[email protected]>
>
> Hi Jiapeng Chong,
>
> this looks good to me.
>
> Reviewed-by: Simon Horman <[email protected]>
>
> While reviewing this gcc 12.2.0 told me:
>
> drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:25: error: unused variable 'bcn_ifs'
> [-Werror=unused-variable]
> 1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
> | ^~~~~~~
> drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:13: error: unused variable 'bcn_cw'
> [-Werror=unused-variable]
> 1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
> | ^~~~~~
>
> So perhaps you could consider sending another patch to remove them too.
>

These errors are introduced by this patch, so please fix them together by this
patch.

Ping-Ke



2023-03-01 10:39:28

by Simon Horman

[permalink] [raw]
Subject: Re: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg

On Wed, Mar 01, 2023 at 12:32:38AM +0000, Ping-Ke Shih wrote:
>
>
> > -----Original Message-----
> > From: Simon Horman <[email protected]>
> > Sent: Tuesday, February 28, 2023 7:07 PM
> > To: Jiapeng Chong <[email protected]>
> > Cc: Ping-Ke Shih <[email protected]>; [email protected]; [email protected]; [email protected];
> > [email protected]; [email protected]; [email protected]; [email protected];
> > [email protected]; Abaci Robot <[email protected]>
> > Subject: Re: [PATCH] rtlwifi: rtl8192se: Remove the unused variable bcntime_cfg
> >
> > On Tue, Feb 28, 2023 at 10:11:32AM +0800, Jiapeng Chong wrote:
> > > Variable bcntime_cfg is not effectively used, so delete it.
> > >
> > > drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:6: warning: variable 'bcntime_cfg' set but not
> > used.
> > >
> > > Reported-by: Abaci Robot <[email protected]>
> > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4240
> > > Signed-off-by: Jiapeng Chong <[email protected]>
> >
> > Hi Jiapeng Chong,
> >
> > this looks good to me.
> >
> > Reviewed-by: Simon Horman <[email protected]>
> >
> > While reviewing this gcc 12.2.0 told me:
> >
> > drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:25: error: unused variable 'bcn_ifs'
> > [-Werror=unused-variable]
> > 1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
> > | ^~~~~~~
> > drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c:1555:13: error: unused variable 'bcn_cw'
> > [-Werror=unused-variable]
> > 1555 | u16 bcn_cw = 6, bcn_ifs = 0xf;
> > | ^~~~~~
> >
> > So perhaps you could consider sending another patch to remove them too.
> >
>
> These errors are introduced by this patch, so please fix them together by this
> patch.

Yes, indeed. Sorry for missing that important point.
Had I noticed it my advice would have been the same as yours.