Re: [PATCH v4 4/4] PCI: of: introduce of_pci_verify_node()

From: kernel test robot

Date: Tue Sep 08 2026 - 06:45:25 EST


Hi Alex,

kernel test robot noticed the following build warnings:

[auto build test WARNING on cee9395acd8043be0644b25c34bfa86623f2b935]

url: https://github.com/intel-lab-lkp/linux/commits/Alex-Elder/PCI-of-avoid-allocations-in-of_pci_prop_compatible/20260904-084603
base: cee9395acd8043be0644b25c34bfa86623f2b935
patch link: https://lore.kernel.org/r/20260904134607.1856121-5-elder%40riscstar.com
patch subject: [PATCH v4 4/4] PCI: of: introduce of_pci_verify_node()
config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20260908/202609081256.UUzbm16V-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260908/202609081256.UUzbm16V-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/202609081256.UUzbm16V-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/pci/of_property.c:335:7: error: incompatible pointer to integer conversion initializing 'char' with an expression of type 'char[48]' [-Wint-conversion]
335 | char bufp = buf;
| ^ ~~~
drivers/pci/of_property.c:338:17: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'char *'; take the address with & [-Wint-conversion]
338 | ret = snprintf(bufp, PROP_SIZE, "pci%x,%x", pdev->vendor, pdev->device);
| ^~~~
| &
include/linux/sprintf.h:13:35: note: passing argument to parameter 'buf' here
13 | __printf(3, 4) int snprintf(char *buf, size_t size, const char *fmt, ...);
| ^
drivers/pci/of_property.c:341:41: error: incompatible integer to pointer conversion assigning to 'const char *' from 'char'; take the address with & [-Wint-conversion]
341 | compat_strs[PROP_COMPAT_PCI_VVVV_DDDD] = bufp;
| ^ ~~~~
| &
drivers/pci/of_property.c:344:17: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'char *'; take the address with & [-Wint-conversion]
344 | ret = snprintf(bufp, PROP_SIZE, "pciclass,%06x", pdev->class);
| ^~~~
| &
include/linux/sprintf.h:13:35: note: passing argument to parameter 'buf' here
13 | __printf(3, 4) int snprintf(char *buf, size_t size, const char *fmt, ...);
| ^
drivers/pci/of_property.c:347:43: error: incompatible integer to pointer conversion assigning to 'const char *' from 'char'; take the address with & [-Wint-conversion]
347 | compat_strs[PROP_COMPAT_PCICLASS_CCSSPP] = bufp;
| ^ ~~~~
| &
drivers/pci/of_property.c:350:17: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'char *'; take the address with & [-Wint-conversion]
350 | ret = snprintf(bufp, PROP_SIZE, "pciclass,%04x", pdev->class >> 8);
| ^~~~
| &
include/linux/sprintf.h:13:35: note: passing argument to parameter 'buf' here
13 | __printf(3, 4) int snprintf(char *buf, size_t size, const char *fmt, ...);
| ^
drivers/pci/of_property.c:351:41: error: incompatible integer to pointer conversion assigning to 'const char *' from 'char'; take the address with & [-Wint-conversion]
351 | compat_strs[PROP_COMPAT_PCICLASS_CCSS] = bufp;
| ^ ~~~~
| &
>> drivers/pci/of_property.c:336:6: warning: unused variable 'i' [-Wunused-variable]
336 | int i, ret;
| ^
1 warning and 7 errors generated.


vim +/i +336 drivers/pci/of_property.c

407d1a51921e9f Lizhi Hou 2023-08-15 326
5a35f85c8e450f Alex Elder 2026-09-04 327 /* The three compatible property strings have max sizes 12+1, 15+1, and 13+1 */
5a35f85c8e450f Alex Elder 2026-09-04 328 #define PROP_SIZE 16 /* Max size of each compatible string */
407d1a51921e9f Lizhi Hou 2023-08-15 329 static int of_pci_prop_compatible(struct pci_dev *pdev,
407d1a51921e9f Lizhi Hou 2023-08-15 330 struct of_changeset *ocs,
407d1a51921e9f Lizhi Hou 2023-08-15 331 struct device_node *np)
407d1a51921e9f Lizhi Hou 2023-08-15 332 {
407d1a51921e9f Lizhi Hou 2023-08-15 333 const char *compat_strs[PROP_COMPAT_NUM] = { 0 };
5a35f85c8e450f Alex Elder 2026-09-04 334 char buf[PROP_COMPAT_NUM * PROP_SIZE] = { };
5a35f85c8e450f Alex Elder 2026-09-04 335 char bufp = buf;
407d1a51921e9f Lizhi Hou 2023-08-15 @336 int i, ret;
407d1a51921e9f Lizhi Hou 2023-08-15 337
5a35f85c8e450f Alex Elder 2026-09-04 338 ret = snprintf(bufp, PROP_SIZE, "pci%x,%x", pdev->vendor, pdev->device);
5a35f85c8e450f Alex Elder 2026-09-04 339 if (ret >= PROP_SIZE)
5a35f85c8e450f Alex Elder 2026-09-04 340 return -EINVAL;
5a35f85c8e450f Alex Elder 2026-09-04 341 compat_strs[PROP_COMPAT_PCI_VVVV_DDDD] = bufp;
5a35f85c8e450f Alex Elder 2026-09-04 342 bufp += ret + 1;
407d1a51921e9f Lizhi Hou 2023-08-15 343
5a35f85c8e450f Alex Elder 2026-09-04 344 ret = snprintf(bufp, PROP_SIZE, "pciclass,%06x", pdev->class);
5a35f85c8e450f Alex Elder 2026-09-04 345 if (ret >= PROP_SIZE)
5a35f85c8e450f Alex Elder 2026-09-04 346 return -EINVAL;
5a35f85c8e450f Alex Elder 2026-09-04 347 compat_strs[PROP_COMPAT_PCICLASS_CCSSPP] = bufp;
5a35f85c8e450f Alex Elder 2026-09-04 348 bufp += ret + 1;
407d1a51921e9f Lizhi Hou 2023-08-15 349
5a35f85c8e450f Alex Elder 2026-09-04 350 ret = snprintf(bufp, PROP_SIZE, "pciclass,%04x", pdev->class >> 8);
5a35f85c8e450f Alex Elder 2026-09-04 351 compat_strs[PROP_COMPAT_PCICLASS_CCSS] = bufp;
5a35f85c8e450f Alex Elder 2026-09-04 352
5a35f85c8e450f Alex Elder 2026-09-04 353 return of_changeset_add_prop_string_array(ocs, np, "compatible",
5a35f85c8e450f Alex Elder 2026-09-04 354 compat_strs, PROP_COMPAT_NUM);
407d1a51921e9f Lizhi Hou 2023-08-15 355 }
5a35f85c8e450f Alex Elder 2026-09-04 356 #undef PROP_SIZE
407d1a51921e9f Lizhi Hou 2023-08-15 357

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