Skip to contentSkip to conversation

drivers/of/unittest.c:3763:14: error: 'overlays' undeclared

PATCH kernel test robot 1 participant 1 message Aug 24, 2023 Memory management

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   2b3bd393093b04d4882152398019cbb96b0440ff
commit: 26409dd045892904b059dc411403e9c8ce7543ca [11796/12477] of: unittest: Add pci_dt_testdrv pci driver
config: x86_64-randconfig-r033-20230824 (https://download.01.org/0day-ci/archive/20230824/[email protected]/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230824/[email protected]/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 protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/of/unittest.c: In function 'testdrv_probe':

>> drivers/of/unittest.c:3763:14: error: 'overlays' undeclared (first use in this function)
    3763 |  for (info = overlays; info && info->name; info++) {
         |              ^~~~~~~~
   drivers/of/unittest.c:3763:14: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/of/unittest.c:3763:36: error: dereferencing pointer to incomplete type 'struct overlay_info'
    3763 |  for (info = overlays; info && info->name; info++) {
         |                                    ^~
>> drivers/of/unittest.c:3763:48: error: increment of pointer to an incomplete type 'struct overlay_info'
    3763 |  for (info = overlays; info && info->name; info++) {
         |                                                ^~
>> drivers/of/unittest.c:3773:8: error: too many arguments to function 'of_overlay_fdt_apply'
    3773 |  ret = of_overlay_fdt_apply(info->dtbo_begin, size, &ovcs_id, dn);
         |        ^~~~~~~~~~~~~~~~~~~~

In file included from drivers/of/unittest.c:15:
include/linux/of.h:1679:19: note: declared here
1679 | static inline int of_overlay_fdt_apply(void *overlay_fdt, u32 overlay_fdt_size,
| ^~~~~~~~~~~~~~~~~~~~

vim +/overlays +3763 drivers/of/unittest.c

3749
3750 static int testdrv_probe(struct pci_dev *pdev, const struct pci_device_id *id)
3751 {
3752 struct overlay_info *info;
3753 struct device_node *dn;
3754 int ret, ovcs_id;
3755 u32 size;
3756
3757 dn = pdev->dev.of_node;
3758 if (!dn) {
3759 dev_err(&pdev->dev, "does not find bus endpoint");
3760 return -EINVAL;
3761 }
3762

> 3763		for (info = overlays; info && info->name; info++) {
  3764			if (!strcmp(info->name, "overlay_pci_node"))
  3765				break;
  3766		}
  3767		if (!info || !info->name) {
  3768			dev_err(&pdev->dev, "no overlay data for overlay_pci_node");
  3769			return -ENODEV;
  3770		}
  3771	
  3772		size = info->dtbo_end - info->dtbo_begin;
> 3773		ret = of_overlay_fdt_apply(info->dtbo_begin, size, &ovcs_id, dn);

3774 of_node_put(dn);
3775 if (ret)
3776 return ret;
3777
3778 of_platform_default_populate(dn, NULL, &pdev->dev);
3779 pci_set_drvdata(pdev, (void *)(uintptr_t)ovcs_id);
3780
3781 return 0;
3782 }
3783

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