Re: [PATCH v10 04/10] PCI: cadence: Add support for High Perf Architecture (HPA) controller

From: Hans Zhang

Date: Mon Oct 20 2025 - 03:27:39 EST




On 10/20/2025 3:19 PM, kernel test robot wrote:
EXTERNAL EMAIL

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 211ddde0823f1442e4ad052a2f30f050145ccada]

url: https://github.com/intel-lab-lkp/linux/commits/hans-zhang-cixtech-com/PCI-cadence-Add-module-support-for-platform-controller-driver/20251020-123246
base: 211ddde0823f1442e4ad052a2f30f050145ccada
patch link: https://lore.kernel.org/r/20251020042857.706786-5-hans.zhang%40cixtech.com
patch subject: [PATCH v10 04/10] PCI: cadence: Add support for High Perf Architecture (HPA) controller
config: i386-buildonly-randconfig-002-20251020 (https://download.01.org/0day-ci/archive/20251020/202510201553.x7S0SaZ1-lkp@xxxxxxxxx/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251020/202510201553.x7S0SaZ1-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202510201553.x7S0SaZ1-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/pci/controller/cadence/pcie-cadence-host-hpa.c:96:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
96 | if (rc->quirk_retrain_flag)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/pci/controller/cadence/pcie-cadence-host-hpa.c:98:9: note: uninitialized use occurs here
98 | return ret;
| ^~~
drivers/pci/controller/cadence/pcie-cadence-host-hpa.c:96:2: note: remove the 'if' if its condition is always true
96 | if (rc->quirk_retrain_flag)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
97 | ret = cdns_pcie_retrain(pcie);
drivers/pci/controller/cadence/pcie-cadence-host-hpa.c:84:18: note: initialize the variable 'ret' to silence this warning
84 | int retries, ret;
| ^
| = 0
1 warning generated.


Hi,

Manikandan is on vacation. I'll wait for some review comments on this series of patches first and then send the next version, which will fix this issue.

int retries, ret = 0;

Best regards,
Hans


vim +96 drivers/pci/controller/cadence/pcie-cadence-host-hpa.c

79
80 static int cdns_pcie_hpa_host_wait_for_link(struct cdns_pcie *pcie)
81 {
82 struct device *dev = pcie->dev;
83 struct cdns_pcie_rc *rc;
84 int retries, ret;
85
86 rc = container_of(pcie, struct cdns_pcie_rc, pcie);
87
88 /* Check if the link is up or not */
89 for (retries = 0; retries < LINK_WAIT_MAX_RETRIES; retries++) {
90 if (cdns_pcie_hpa_link_up(pcie)) {
91 dev_info(dev, "Link up\n");
92 return 0;
93 }
94 usleep_range(LINK_WAIT_USLEEP_MIN, LINK_WAIT_USLEEP_MAX);
95 }
> 96 if (rc->quirk_retrain_flag)
97 ret = cdns_pcie_retrain(pcie);
98 return ret;
99 }
100

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