linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lizhi Hou <lizhi.hou@xilinx.com>, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, Lizhi Hou <lizhi.hou@xilinx.com>,
	linux-fpga@vger.kernel.org, maxz@xilinx.com,
	sonal.santan@xilinx.com, yliu@xilinx.com,
	michal.simek@xilinx.com, stefanos@xilinx.com,
	devicetree@vger.kernel.org, trix@redhat.com
Subject: Re: [PATCH V4 XRT Alveo Infrastructure 3/5] of: create empty of root
Date: Sat, 8 Jan 2022 11:34:52 +0800	[thread overview]
Message-ID: <202201081100.CZieN1nu-lkp@intel.com> (raw)
In-Reply-To: <20220105225013.1567871-4-lizhi.hou@xilinx.com>

Hi Lizhi,

I love your patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.16-rc8 next-20220107]
[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/20220106-065312
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: i386-randconfig-m021-20220105 (https://download.01.org/0day-ci/archive/20220108/202201081100.CZieN1nu-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

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

New smatch warnings:
drivers/of/fdt.c:541 of_fdt_root_init() warn: inconsistent indenting

Old smatch warnings:
drivers/of/fdt.c:1313 early_init_dt_add_memory_arch() warn: unsigned 'base + size' is never less than zero.
drivers/of/fdt.c:1318 early_init_dt_add_memory_arch() warn: unsigned 'base' is never less than zero.
drivers/of/fdt.c:1428 unflatten_and_copy_device_tree() warn: should '1 << (((__builtin_constant_p((((((7 * 4) + 4) + 4) + 4)) - 1)) ?((((((((7 * 4) + 4) + 4) + 4)) - 1) < 2) ?0:63 - __builtin_clzll((((((7 * 4) + 4) + 4) + 4)) - 1)):((4 <= 4)) ?__ilog2_u32((((((7 * 4) + 4) + 4) + 4)) - 1):__ilog2_u64((((((7 * 4) + 4) + 4) + 4)) - 1)) + 1)' be a 64 bit type?

vim +541 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 = NULL, *fdt_aligned;
   473		struct property *prop = NULL;
   474		__be32 *val = NULL;
   475		int size, rc = 0;
   476	
   477	#if !defined(CONFIG_OF_UNITTEST)
   478		if (of_root)
   479			return 0;
   480	#endif
   481		size = __dtb_fdt_default_end - __dtb_fdt_default_begin;
   482	
   483		fdt = kmalloc(size + FDT_ALIGN_SIZE, GFP_KERNEL);
   484		if (!fdt)
   485			return -ENOMEM;
   486	
   487		fdt_aligned = PTR_ALIGN(fdt, FDT_ALIGN_SIZE);
   488		memcpy(fdt_aligned, __dtb_fdt_default_begin, size);
   489	
   490		if (!of_fdt_unflatten_tree((const unsigned long *)fdt_aligned,
   491					   NULL, &dt)) {
   492			pr_warn("%s: unflatten default tree failed\n", __func__);
   493			kfree(fdt);
   494			return -ENODATA;
   495		}
   496		if (!dt) {
   497			pr_warn("%s: empty default tree\n", __func__);
   498			kfree(fdt);
   499			return -ENODATA;
   500		}
   501	
   502		/*
   503		 * This lock normally encloses of_resolve_phandles()
   504		 */
   505		of_overlay_mutex_lock();
   506	
   507		rc = of_resolve_phandles(dt);
   508		if (rc) {
   509			pr_err("%s: Failed to resolve phandles (rc=%i)\n", __func__, rc);
   510			goto failed;
   511		}
   512	
   513		if (!of_root) {
   514			prop = kcalloc(2, sizeof(*prop), GFP_KERNEL);
   515			if (!prop) {
   516				rc = -ENOMEM;
   517				goto failed;
   518			}
   519			val = kzalloc(sizeof(*val), GFP_KERNEL);
   520			if (!val) {
   521				rc = -ENOMEM;
   522				goto failed;
   523			}
   524			*val = cpu_to_be32(sizeof(void *) / sizeof(u32));
   525	
   526			prop->name = "#address-cells";
   527			prop->value = val;
   528			prop->length = sizeof(u32);
   529			of_add_property(dt, prop);
   530			prop++;
   531			prop->name = "#size-cells";
   532			prop->value = val;
   533			prop->length = sizeof(u32);
   534			of_add_property(dt, prop);
   535			of_root = dt;
   536			for_each_of_allnodes(np)
   537				__of_attach_node_sysfs(np);
   538			of_aliases = of_find_node_by_path("/aliases");
   539			of_chosen = of_find_node_by_path("/chosen");
   540			of_overlay_mutex_unlock();
 > 541	pr_info("OF ROOT FLAG %lx\n", of_root->_flags);
   542			return 0;
   543		}
   544	
   545		unittest_data_add(dt);
   546	
   547		of_overlay_mutex_unlock();
   548	
   549		return 0;
   550	
   551	failed:
   552		of_overlay_mutex_unlock();
   553		kfree(val);
   554		kfree(prop);
   555		return rc;
   556	}
   557	pure_initcall(of_fdt_root_init);
   558	

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

  reply	other threads:[~2022-01-08  3:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-05 22:50 [PATCH V4 XRT Alveo Infrastructure 0/5] XRT Alveo driver infrastructure overview Lizhi Hou
2022-01-05 22:50 ` [PATCH V4 XRT Alveo Infrastructure 1/5] Documentation: fpga: Add a document describing XRT Alveo driver infrastructure Lizhi Hou
2022-01-09 17:38   ` Tom Rix
2022-01-05 22:50 ` [PATCH V4 XRT Alveo Infrastructure 2/5] Documentation: devicetree: bindings: add binding for Alveo platform Lizhi Hou
2022-01-09 17:46   ` Tom Rix
2022-01-05 22:50 ` [PATCH V4 XRT Alveo Infrastructure 3/5] of: create empty of root Lizhi Hou
2022-01-08  3:34   ` kernel test robot [this message]
2022-01-09 18:39   ` Tom Rix
2022-01-11  1:14     ` Lizhi Hou
2022-01-11  4:29   ` Xu Yilun
2022-01-19 18:59     ` Lizhi Hou
2022-01-21  1:42       ` Xu Yilun
2022-01-21 16:54         ` Lizhi Hou
2022-01-05 22:50 ` [PATCH V4 XRT Alveo Infrastructure 4/5] fpga: xrt: xrt-lib common interfaces Lizhi Hou
2022-01-09 21:16   ` Tom Rix
2022-01-11  6:35     ` Xu Yilun
2022-01-05 22:50 ` [PATCH V4 XRT Alveo Infrastructure 5/5] fpga: xrt: management physical function driver Lizhi Hou
2022-01-09 21:34   ` Tom Rix
2022-01-11  7:00   ` Xu Yilun
2022-01-13 23:41     ` Lizhi Hou
2022-01-14  1:43       ` Xu Yilun
2022-01-17 17:43         ` Lizhi Hou
2022-01-18  1:36           ` Xu Yilun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202201081100.CZieN1nu-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhi.hou@xilinx.com \
    --cc=maxz@xilinx.com \
    --cc=michal.simek@xilinx.com \
    --cc=sonal.santan@xilinx.com \
    --cc=stefanos@xilinx.com \
    --cc=trix@redhat.com \
    --cc=yliu@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).