All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Wentao Liang <vulab@iscas.ac.cn>,
	gregkh@linuxfoundation.org, philipp.g.hortmann@gmail.com
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	Wentao Liang <vulab@iscas.ac.cn>
Subject: Re: [PATCH] staging: rtl8723bs: Add error handling for sd_read().
Date: Fri, 4 Apr 2025 23:52:04 +0800	[thread overview]
Message-ID: <202504042334.1pXFeKzN-lkp@intel.com> (raw)
In-Reply-To: <20250403093741.2372-1-vulab@iscas.ac.cn>

Hi Wentao,

kernel test robot noticed the following build warnings:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/intel-lab-lkp/linux/commits/Wentao-Liang/staging-rtl8723bs-Add-error-handling-for-sd_read/20250403-174101
base:   staging/staging-testing
patch link:    https://lore.kernel.org/r/20250403093741.2372-1-vulab%40iscas.ac.cn
patch subject: [PATCH] staging: rtl8723bs: Add error handling for sd_read().
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250404/202504042334.1pXFeKzN-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 92c93f5286b9ff33f27ff694d2dc33da1c07afdd)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250404/202504042334.1pXFeKzN-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202504042334.1pXFeKzN-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/staging/rtl8723bs/hal/sdio_ops.c:189:7: warning: variable 'val' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     189 |                 if (!err) {
         |                     ^~~~
   drivers/staging/rtl8723bs/hal/sdio_ops.c:196:9: note: uninitialized use occurs here
     196 |         return val;
         |                ^~~
   drivers/staging/rtl8723bs/hal/sdio_ops.c:189:3: note: remove the 'if' if its condition is always true
     189 |                 if (!err) {
         |                 ^~~~~~~~~
   drivers/staging/rtl8723bs/hal/sdio_ops.c:159:9: note: initialize the variable 'val' to silence this warning
     159 |         u32 val;
         |                ^
         |                 = 0
   1 warning generated.


vim +189 drivers/staging/rtl8723bs/hal/sdio_ops.c

   150	
   151	static u32 sdio_read32(struct intf_hdl *intfhdl, u32 addr)
   152	{
   153		struct adapter *adapter;
   154		u8 mac_pwr_ctrl_on;
   155		u8 device_id;
   156		u16 offset;
   157		u32 ftaddr;
   158		u8 shift;
   159		u32 val;
   160		s32 __maybe_unused err;
   161		__le32 le_tmp;
   162	
   163		adapter = intfhdl->padapter;
   164		ftaddr = _cvrt2ftaddr(addr, &device_id, &offset);
   165	
   166		rtw_hal_get_hwreg(adapter, HW_VAR_APFM_ON_MAC, &mac_pwr_ctrl_on);
   167		if (
   168			((device_id == WLAN_IOREG_DEVICE_ID) && (offset < 0x100)) ||
   169			(!mac_pwr_ctrl_on) ||
   170			(adapter_to_pwrctl(adapter)->fw_current_in_ps_mode)
   171		) {
   172			err = sd_cmd52_read(intfhdl, ftaddr, 4, (u8 *)&le_tmp);
   173			return le32_to_cpu(le_tmp);
   174		}
   175	
   176		/*  4 bytes alignment */
   177		shift = ftaddr & 0x3;
   178		if (shift == 0) {
   179			val = sd_read32(intfhdl, ftaddr, NULL);
   180		} else {
   181			u8 *tmpbuf;
   182	
   183			tmpbuf = rtw_malloc(8);
   184			if (!tmpbuf)
   185				return SDIO_ERR_VAL32;
   186	
   187			ftaddr &= ~(u16)0x3;
   188			err = sd_read(intfhdl, ftaddr, 8, tmpbuf);
 > 189			if (!err) {
   190				memcpy(&le_tmp, tmpbuf + shift, 4);
   191				val = le32_to_cpu(le_tmp);
   192			}
   193	
   194			kfree(tmpbuf);
   195		}
   196		return val;
   197	}
   198	

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

      parent reply	other threads:[~2025-04-04 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03  9:37 [PATCH] staging: rtl8723bs: Add error handling for sd_read() Wentao Liang
2025-04-03 12:10 ` Dan Carpenter
2025-04-04 15:52 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202504042334.1pXFeKzN-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=philipp.g.hortmann@gmail.com \
    --cc=vulab@iscas.ac.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.