linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Stephen Boyd <swboyd@chromium.org>
Cc: kbuild-all@01.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	Wei-Ning Huang <wnhuang@chromium.org>,
	Julius Werner <jwerner@chromium.org>,
	Brian Norris <briannorris@chromium.org>,
	Samuel Holland <samuel@sholland.org>,
	Sudeep Holla <Sudeep.Holla@arm.com>
Subject: Re: [PATCH v2 2/2] firmware: coreboot: Collapse platform drivers into bus core
Date: Fri, 10 Aug 2018 06:13:42 +0800	[thread overview]
Message-ID: <201808100649.mgka0SgL%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180808172414.29983-3-swboyd@chromium.org>

Hi Stephen,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.18-rc8 next-20180809]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Stephen-Boyd/firmware-coreboot-Fix-probe-and-simplify-code/20180810-015624
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   drivers/firmware/google/coreboot_table.c:113:22: sparse: cast removes address space of expression
   drivers/firmware/google/coreboot_table.c:115:39: sparse: incorrect type in argument 2 (different address spaces) @@    expected void const volatile [noderef] <asn:2>*addr @@    got noderef] <asn:2>*addr @@
   drivers/firmware/google/coreboot_table.c:115:39:    expected void const volatile [noderef] <asn:2>*addr
   drivers/firmware/google/coreboot_table.c:115:39:    got void *[assigned] ptr_entry
   drivers/firmware/google/coreboot_table.c:127:47: sparse: incorrect type in argument 2 (different address spaces) @@    expected void const volatile [noderef] <asn:2>*addr @@    got noderef] <asn:2>*addr @@
   drivers/firmware/google/coreboot_table.c:127:47:    expected void const volatile [noderef] <asn:2>*addr
   drivers/firmware/google/coreboot_table.c:127:47:    got void *[assigned] ptr_entry
>> drivers/firmware/google/coreboot_table.c:163:29: sparse: dereference of noderef expression
   drivers/firmware/google/coreboot_table.c:163:52: sparse: dereference of noderef expression

vim +163 drivers/firmware/google/coreboot_table.c

    96	
    97	static int coreboot_table_init(struct device *dev, void __iomem *ptr)
    98	{
    99		int i, ret;
   100		void *ptr_entry;
   101		struct coreboot_device *device;
   102		struct coreboot_table_entry entry;
   103		struct coreboot_table_header header;
   104	
   105		ptr_header = ptr;
   106		memcpy_fromio(&header, ptr_header, sizeof(header));
   107	
   108		if (strncmp(header.signature, "LBIO", sizeof(header.signature))) {
   109			pr_warn("coreboot_table: coreboot table missing or corrupt!\n");
   110			return -ENODEV;
   111		}
   112	
 > 113		ptr_entry = (void *)ptr_header + header.header_bytes;
   114		for (i = 0; i < header.table_entries; i++) {
   115			memcpy_fromio(&entry, ptr_entry, sizeof(entry));
   116	
   117			device = kzalloc(sizeof(struct device) + entry.size, GFP_KERNEL);
   118			if (!device) {
   119				ret = -ENOMEM;
   120				break;
   121			}
   122	
   123			dev_set_name(&device->dev, "coreboot%d", i);
   124			device->dev.parent = dev;
   125			device->dev.bus = &coreboot_bus_type;
   126			device->dev.release = coreboot_device_release;
   127			memcpy_fromio(&device->entry, ptr_entry, entry.size);
   128	
   129			ret = device_register(&device->dev);
   130			if (ret) {
   131				put_device(&device->dev);
   132				break;
   133			}
   134	
   135			ptr_entry += entry.size;
   136		}
   137	
   138		return ret;
   139	}
   140	
   141	static int coreboot_table_probe(struct platform_device *pdev)
   142	{
   143		phys_addr_t phyaddr;
   144		resource_size_t len;
   145		struct coreboot_table_header __iomem *header = NULL;
   146		struct resource *res;
   147		void __iomem *ptr = NULL;
   148	
   149		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   150		if (!res)
   151			return -EINVAL;
   152	
   153		len = resource_size(res);
   154		if (!res->start || !len)
   155			return -EINVAL;
   156	
   157		phyaddr = res->start;
   158		header = ioremap_cache(phyaddr, sizeof(*header));
   159		if (header == NULL)
   160			return -ENOMEM;
   161	
   162		ptr = ioremap_cache(phyaddr,
 > 163				    header->header_bytes + header->table_bytes);
   164		iounmap(header);
   165		if (!ptr)
   166			return -ENOMEM;
   167	
   168		return coreboot_table_init(&pdev->dev, ptr);
   169	}
   170	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

      parent reply	other threads:[~2018-08-09 22:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 17:24 [PATCH v2 0/2] firmware: coreboot: Fix probe and simplify code Stephen Boyd
2018-08-08 17:24 ` [PATCH v2 1/2] firmware: coreboot: Let OF core populate platform device Stephen Boyd
2018-08-09  9:15   ` Sudeep Holla
2018-08-08 17:24 ` [PATCH v2 2/2] firmware: coreboot: Collapse platform drivers into bus core Stephen Boyd
2018-08-08 19:07   ` Julius Werner
2018-08-08 23:42     ` Stephen Boyd
2018-08-09 19:33   ` kbuild test robot
2018-08-09 22:13   ` kbuild test robot [this message]

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=201808100649.mgka0SgL%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=briannorris@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jwerner@chromium.org \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samuel@sholland.org \
    --cc=swboyd@chromium.org \
    --cc=wnhuang@chromium.org \
    /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).