Re: [PATCH V3 XRT Alveo Infrastructure 3/8] of: create empty of root

From: kernel test robot
Date: Fri Dec 03 2021 - 23:42:42 EST


Hi Lizhi,

I love your patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on linux/master linus/master v5.16-rc3 next-20211203]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Lizhi-Hou/XRT-Alveo-driver-infrastructure-overview/20211204-084333
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: nds32-allnoconfig (https://download.01.org/0day-ci/archive/20211204/202112041242.HCDtTlb5-lkp@xxxxxxxxx/config)
compiler: nds32le-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/1b36c19ebc303a293dff82ed399ea70bf4ddde50
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Lizhi-Hou/XRT-Alveo-driver-infrastructure-overview/20211204-084333
git checkout 1b36c19ebc303a293dff82ed399ea70bf4ddde50
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=nds32 SHELL=/bin/bash drivers/of/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

drivers/of/fdt.c: In function 'of_fdt_root_init':
>> drivers/of/fdt.c:505:14: error: implicit declaration of function 'of_resolve_phandles'; did you mean 'of_parse_phandle'? [-Werror=implicit-function-declaration]
505 | rc = of_resolve_phandles(dt);
| ^~~~~~~~~~~~~~~~~~~
| of_parse_phandle
cc1: some warnings being treated as errors


vim +505 drivers/of/fdt.c

468
469 static int __init of_fdt_root_init(void)
470 {
471 struct device_node *dt = NULL, *np;
472 void *fdt, *fdt_aligned;
473 int size, rc;
474
475 #if !defined(CONFIG_OF_UNITTEST)
476 if (of_root)
477 return 0;
478 #endif
479 size = __dtb_fdt_default_end - __dtb_fdt_default_begin;
480
481 fdt = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);
482 if (!fdt)
483 return -ENOMEM;
484
485 fdt_aligned = PTR_ALIGN(fdt, FDT_ALIGN_SIZE);
486 memcpy(fdt_aligned, __dtb_fdt_default_begin, size);
487
488 if (!of_fdt_unflatten_tree((const unsigned long *)fdt_aligned,
489 NULL, &dt)) {
490 pr_warn("%s: unflatten default tree failed\n", __func__);
491 kfree(fdt);
492 return -ENODATA;
493 }
494 if (!dt) {
495 pr_warn("%s: empty default tree\n", __func__);
496 kfree(fdt);
497 return -ENODATA;
498 }
499
500 /*
501 * This lock normally encloses of_resolve_phandles()
502 */
503 of_overlay_mutex_lock();
504
> 505 rc = of_resolve_phandles(dt);
506 if (rc) {
507 pr_err("%s: Failed to resolve phandles (rc=%i)\n", __func__, rc);
508 of_overlay_mutex_unlock();
509 return -EINVAL;
510 }
511
512 if (!of_root) {
513 of_root = dt;
514 for_each_of_allnodes(np)
515 __of_attach_node_sysfs(np);
516 of_aliases = of_find_node_by_path("/aliases");
517 of_chosen = of_find_node_by_path("/chosen");
518 of_overlay_mutex_unlock();
519 return 0;
520 }
521
522 unittest_data_add(dt);
523
524 of_overlay_mutex_unlock();
525
526 return 0;
527 }
528 pure_initcall(of_fdt_root_init);
529

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx