All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'
@ 2023-02-10 16:11 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-02-10  2:08 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Ping-Ke Shih" <pkshih@realtek.com>
CC: Kalle Valo <kvalo@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e544a07438522ab3688416e6e2e34bf0ee6d8755
commit: 7ba49f4c6896d83b3841c0b046a0a7b1e97cc0dd rtw89: 8852c: add 8852ce to Makefile and Kconfig
date:   9 months ago
:::::: branch date: 7 hours ago
:::::: commit date: 9 months ago
config: parisc-randconfig-m031-20230209 (https://download.01.org/0day-ci/archive/20230210/202302101023.ctlih5q0-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202302101023.ctlih5q0-lkp@intel.com/

smatch warnings:
drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'

vim +/ret +3829 drivers/net/wireless/realtek/rtw89/mac.c

e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3817  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3818  int rtw89_mac_cfg_ppdu_status(struct rtw89_dev *rtwdev, u8 mac_idx, bool enable)
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3819  {
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3820  	u32 reg = rtw89_mac_reg_by_idx(R_AX_PPDU_STAT, mac_idx);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3821  	int ret = 0;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3822  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3823  	ret = rtw89_mac_check_mac_en(rtwdev, mac_idx, RTW89_CMAC_SEL);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3824  	if (ret)
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3825  		return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3826  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3827  	if (!enable) {
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3828  		rtw89_write32_clr(rtwdev, reg, B_AX_PPDU_STAT_RPT_EN);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11 @3829  		return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3830  	}
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3831  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3832  	rtw89_write32(rtwdev, reg, B_AX_PPDU_STAT_RPT_EN |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3833  				   B_AX_APP_MAC_INFO_RPT |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3834  				   B_AX_APP_RX_CNT_RPT | B_AX_APP_PLCP_HDR_RPT |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3835  				   B_AX_PPDU_STAT_RPT_CRC32);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3836  	rtw89_write32_mask(rtwdev, R_AX_HW_RPT_FWD, B_AX_FWD_PPDU_STAT_MASK,
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3837  			   RTW89_PRPT_DEST_HOST);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3838  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3839  	return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3840  }
861e58c8fc6be0 Zong-Zhe Yang 2021-12-21  3841  EXPORT_SYMBOL(rtw89_mac_cfg_ppdu_status);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3842  

:::::: The code at line 3829 was first introduced by commit
:::::: e3ec7017f6a20d12ddd9fe23d345ebb7b8c104dd rtw89: add Realtek 802.11ax driver

:::::: TO: Ping-Ke Shih <pkshih@realtek.com>
:::::: CC: Kalle Valo <kvalo@codeaurora.org>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'
@ 2023-02-10 16:11 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2023-02-10 16:11 UTC (permalink / raw)
  To: oe-kbuild, Ping-Ke Shih; +Cc: lkp, oe-kbuild-all, linux-kernel, Kalle Valo

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e544a07438522ab3688416e6e2e34bf0ee6d8755
commit: 7ba49f4c6896d83b3841c0b046a0a7b1e97cc0dd rtw89: 8852c: add 8852ce to Makefile and Kconfig
config: parisc-randconfig-m031-20230209 (https://download.01.org/0day-ci/archive/20230210/202302101023.ctlih5q0-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202302101023.ctlih5q0-lkp@intel.com/

smatch warnings:
drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'

vim +/ret +3829 drivers/net/wireless/realtek/rtw89/mac.c

e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3818  int rtw89_mac_cfg_ppdu_status(struct rtw89_dev *rtwdev, u8 mac_idx, bool enable)
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3819  {
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3820  	u32 reg = rtw89_mac_reg_by_idx(R_AX_PPDU_STAT, mac_idx);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3821  	int ret = 0;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3822  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3823  	ret = rtw89_mac_check_mac_en(rtwdev, mac_idx, RTW89_CMAC_SEL);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3824  	if (ret)
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3825  		return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3826  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3827  	if (!enable) {
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3828  		rtw89_write32_clr(rtwdev, reg, B_AX_PPDU_STAT_RPT_EN);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11 @3829  		return ret;

The code is correct, but it would be more readable to return 0;

e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3830  	}
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3831  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3832  	rtw89_write32(rtwdev, reg, B_AX_PPDU_STAT_RPT_EN |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3833  				   B_AX_APP_MAC_INFO_RPT |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3834  				   B_AX_APP_RX_CNT_RPT | B_AX_APP_PLCP_HDR_RPT |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3835  				   B_AX_PPDU_STAT_RPT_CRC32);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3836  	rtw89_write32_mask(rtwdev, R_AX_HW_RPT_FWD, B_AX_FWD_PPDU_STAT_MASK,
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3837  			   RTW89_PRPT_DEST_HOST);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3838  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3839  	return ret;

Same here.

e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3840  }

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'
  2023-02-10 16:11 ` Dan Carpenter
  (?)
@ 2023-02-13  0:57 ` Ping-Ke Shih
  -1 siblings, 0 replies; 4+ messages in thread
From: Ping-Ke Shih @ 2023-02-13  0:57 UTC (permalink / raw)
  To: Dan Carpenter, oe-kbuild; +Cc: lkp, oe-kbuild-all, linux-kernel, Kalle Valo

Hi,

> -----Original Message-----
> From: Dan Carpenter <error27@gmail.com>
> Sent: Saturday, February 11, 2023 12:11 AM
> To: oe-kbuild@lists.linux.dev; Ping-Ke Shih <pkshih@realtek.com>
> Cc: lkp@intel.com; oe-kbuild-all@lists.linux.dev; linux-kernel@vger.kernel.org; Kalle Valo
> <kvalo@kernel.org>
> Subject: drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error
> code? 'ret'
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   e544a07438522ab3688416e6e2e34bf0ee6d8755
> commit: 7ba49f4c6896d83b3841c0b046a0a7b1e97cc0dd rtw89: 8852c: add 8852ce to Makefile and Kconfig
> config: parisc-randconfig-m031-20230209
> (https://download.01.org/0day-ci/archive/20230210/202302101023.ctlih5q0-lkp@intel.com/config)
> compiler: hppa-linux-gcc (GCC) 12.1.0
> 
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <error27@gmail.com>
> | Link: https://lore.kernel.org/r/202302101023.ctlih5q0-lkp@intel.com/
> 
> smatch warnings:
> drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'
> 
> vim +/ret +3829 drivers/net/wireless/realtek/rtw89/mac.c
> 
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3818  int rtw89_mac_cfg_ppdu_status(struct rtw89_dev *rtwdev, u8
> mac_idx, bool enable)
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3819  {
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3820  	u32 reg = rtw89_mac_reg_by_idx(R_AX_PPDU_STAT, mac_idx);
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3821  	int ret = 0;
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3822
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3823  	ret = rtw89_mac_check_mac_en(rtwdev, mac_idx,
> RTW89_CMAC_SEL);
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3824  	if (ret)
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3825  		return ret;
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3826
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3827  	if (!enable) {
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3828  		rtw89_write32_clr(rtwdev, reg,
> B_AX_PPDU_STAT_RPT_EN);
> e3ec7017f6a20d Ping-Ke Shih  2021-10-11 @3829  		return ret;
> 
> The code is correct, but it would be more readable to return 0;

Yes, it will be more readable. I will send a patch to change them soon.
Thanks for pointing out this.

Ping-Ke



^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'
@ 2023-02-11 12:23 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-02-11 12:23 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: "Ping-Ke Shih" <pkshih@realtek.com>
CC: Kalle Valo <kvalo@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   420b2d431d18a2572c8e86579e78105cb5ed45b0
commit: 7ba49f4c6896d83b3841c0b046a0a7b1e97cc0dd rtw89: 8852c: add 8852ce to Makefile and Kconfig
date:   9 months ago
:::::: branch date: 13 hours ago
:::::: commit date: 9 months ago
config: parisc-randconfig-m031-20230209 (https://download.01.org/0day-ci/archive/20230211/202302112006.7ANjocXz-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202302112006.7ANjocXz-lkp@intel.com/

smatch warnings:
drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret'

vim +/ret +3829 drivers/net/wireless/realtek/rtw89/mac.c

e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3817  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3818  int rtw89_mac_cfg_ppdu_status(struct rtw89_dev *rtwdev, u8 mac_idx, bool enable)
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3819  {
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3820  	u32 reg = rtw89_mac_reg_by_idx(R_AX_PPDU_STAT, mac_idx);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3821  	int ret = 0;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3822  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3823  	ret = rtw89_mac_check_mac_en(rtwdev, mac_idx, RTW89_CMAC_SEL);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3824  	if (ret)
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3825  		return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3826  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3827  	if (!enable) {
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3828  		rtw89_write32_clr(rtwdev, reg, B_AX_PPDU_STAT_RPT_EN);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11 @3829  		return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3830  	}
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3831  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3832  	rtw89_write32(rtwdev, reg, B_AX_PPDU_STAT_RPT_EN |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3833  				   B_AX_APP_MAC_INFO_RPT |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3834  				   B_AX_APP_RX_CNT_RPT | B_AX_APP_PLCP_HDR_RPT |
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3835  				   B_AX_PPDU_STAT_RPT_CRC32);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3836  	rtw89_write32_mask(rtwdev, R_AX_HW_RPT_FWD, B_AX_FWD_PPDU_STAT_MASK,
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3837  			   RTW89_PRPT_DEST_HOST);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3838  
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3839  	return ret;
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3840  }
861e58c8fc6be0 Zong-Zhe Yang 2021-12-21  3841  EXPORT_SYMBOL(rtw89_mac_cfg_ppdu_status);
e3ec7017f6a20d Ping-Ke Shih  2021-10-11  3842  

:::::: The code at line 3829 was first introduced by commit
:::::: e3ec7017f6a20d12ddd9fe23d345ebb7b8c104dd rtw89: add Realtek 802.11ax driver

:::::: TO: Ping-Ke Shih <pkshih@realtek.com>
:::::: CC: Kalle Valo <kvalo@codeaurora.org>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-13  0:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-10  2:08 drivers/net/wireless/realtek/rtw89/mac.c:3829 rtw89_mac_cfg_ppdu_status() warn: missing error code? 'ret' kernel test robot
2023-02-10 16:11 ` Dan Carpenter
2023-02-13  0:57 ` Ping-Ke Shih
2023-02-11 12:23 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.