Subject: Re: [net-next v1] net: wwan: t7xx: PCIe reset rescan

From: kernel test robot <[email-masked]>
Date: Fri, 9 Aug 2024 07:08:16 +0800

Hi Jinjian,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jinjian-Song/net-wwan-t7xx-PCIe-reset-rescan/20240808-192313
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240808111801.8514-1-jinjian.song%40fibocom.com
patch subject: [net-next v1] net: wwan: t7xx: PCIe reset rescan
config: i386-buildonly-randconfig-004-20240809 (https://download.01.org/0day-ci/archive/20240809/[email-masked]/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240809/[email-masked]/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 <[email-masked]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email-masked]/

All warnings (new ones prefixed by >>):

>> drivers/net/wwan/t7xx/t7xx_modem_ops.c:204:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
     204 |         } else if (type == PLDR) {
         |                    ^~~~~~~~~~~~
   drivers/net/wwan/t7xx/t7xx_modem_ops.c:215:9: note: uninitialized use occurs here
     215 |         return ret;
         |                ^~~
   drivers/net/wwan/t7xx/t7xx_modem_ops.c:204:9: note: remove the 'if' if its condition is always true
     204 |         } else if (type == PLDR) {
         |                ^~~~~~~~~~~~~~~~~
     205 |                 ret = t7xx_acpi_reset(t7xx_dev, "MRST._RST");
     206 |         } else if (type == FASTBOOT) {
         |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     207 |                 t7xx_host_event_notify(t7xx_dev, FASTBOOT_DL_NOTIFY);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     208 |                 t7xx_mhccif_h2d_swint_trigger(t7xx_dev, H2D_CH_DEVICE_RESET);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     209 |                 msleep(FASTBOOT_RESET_DELAY_MS);
         |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     210 |         }
         |         ~
   drivers/net/wwan/t7xx/t7xx_modem_ops.c:196:9: note: initialize the variable 'ret' to silence this warning
     196 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.

vim +204 drivers/net/wwan/t7xx/t7xx_modem_ops.c

   193	
   194	int t7xx_reset_device(struct t7xx_pci_dev *t7xx_dev, enum reset_type type)
   195	{
   196		int ret;
   197	
   198		pci_save_state(t7xx_dev->pdev);
   199		t7xx_pci_reprobe_early(t7xx_dev);
   200		t7xx_mode_update(t7xx_dev, T7XX_RESET);
   201	
   202		if (type == FLDR) {
   203			ret = t7xx_acpi_reset(t7xx_dev, "_RST");
 > 204		} else if (type == PLDR) {
   205			ret = t7xx_acpi_reset(t7xx_dev, "MRST._RST");
   206		} else if (type == FASTBOOT) {
   207			t7xx_host_event_notify(t7xx_dev, FASTBOOT_DL_NOTIFY);
   208			t7xx_mhccif_h2d_swint_trigger(t7xx_dev, H2D_CH_DEVICE_RESET);
   209			msleep(FASTBOOT_RESET_DELAY_MS);
   210		}
   211	
   212		pci_restore_state(t7xx_dev->pdev);
   213		t7xx_pci_reprobe(t7xx_dev, true);
   214	
   215		return ret;
   216	}
   217	

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