From: kbuild test robot <lkp@intel.com>
To: patrick.rudolph@9elements.com
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
coreboot@coreboot.org,
Patrick Rudolph <patrick.rudolph@9elements.com>,
Thomas Gleixner <tglx@linutronix.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexios Zavras <alexios.zavras@intel.com>,
Allison Randal <allison@lohutok.net>,
Stephen Boyd <swboyd@chromium.org>,
Julius Werner <jwerner@chromium.org>,
Samuel Holland <samuel@sholland.org>
Subject: Re: [PATCH 1/2] firmware: google: Expose CBMEM over sysfs
Date: Sun, 17 Nov 2019 09:18:33 +0800 [thread overview]
Message-ID: <201911170909.p3H1NF75%lkp@intel.com> (raw)
In-Reply-To: <20191115161524.23738-2-patrick.rudolph@9elements.com>
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.4-rc7 next-20191115]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/patrick-rudolph-9elements-com/firmware-google-Expose-coreboot-tables-and-CBMEM/20191116-033417
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 96b95eff4a591dbac582c2590d067e356a18aacb
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-32-g233d4e1-dirty
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/google/cbmem-coreboot.c:79:44: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected void const *from @@ got void [noderef] <asvoid const *from @@
>> drivers/firmware/google/cbmem-coreboot.c:79:44: sparse: expected void const *from
>> drivers/firmware/google/cbmem-coreboot.c:79:44: sparse: got void [noderef] <asn:2> *const remap
>> drivers/firmware/google/cbmem-coreboot.c:110:21: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] <asn:2> *remap @@ got n:2> *remap @@
>> drivers/firmware/google/cbmem-coreboot.c:110:21: sparse: expected void [noderef] <asn:2> *remap
>> drivers/firmware/google/cbmem-coreboot.c:110:21: sparse: got void *
>> drivers/firmware/google/cbmem-coreboot.c:120:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asvoid *addr @@
>> drivers/firmware/google/cbmem-coreboot.c:120:30: sparse: expected void *addr
>> drivers/firmware/google/cbmem-coreboot.c:120:30: sparse: got void [noderef] <asn:2> *remap
>> drivers/firmware/google/cbmem-coreboot.c:142:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void *addr @@ got void [noderef] <asn:2> *void *addr @@
drivers/firmware/google/cbmem-coreboot.c:142:30: sparse: expected void *addr
drivers/firmware/google/cbmem-coreboot.c:142:30: sparse: got void [noderef] <asn:2> *const remap
vim +79 drivers/firmware/google/cbmem-coreboot.c
68
69 static ssize_t cbmem_data_read(struct file *filp, struct kobject *kobj,
70 struct bin_attribute *bin_attr,
71 char *buffer, loff_t offset, size_t count)
72 {
73 struct device *dev = kobj_to_dev(kobj);
74 const struct cb_priv *priv;
75
76 priv = (const struct cb_priv *)dev_get_platdata(dev);
77
78 return memory_read_from_buffer(buffer, count, &offset,
> 79 priv->remap, priv->entry.size);
80 }
81
82 static struct bin_attribute coreboot_attr_data = {
83 .attr = { .name = "data", .mode = 0444 },
84 .read = cbmem_data_read,
85 };
86
87 static struct bin_attribute *cb_mem_bin_attrs[] = {
88 &coreboot_attr_data,
89 NULL
90 };
91
92 static struct attribute_group cb_mem_attr_group = {
93 .name = "cbmem_attributes",
94 .attrs = cb_mem_attrs,
95 .bin_attrs = cb_mem_bin_attrs,
96 };
97
98 static int cbmem_probe(struct coreboot_device *cdev)
99 {
100 struct device *dev = &cdev->dev;
101 struct cb_priv *priv;
102 int err;
103
104 priv = kzalloc(sizeof(*priv), GFP_KERNEL);
105 if (!priv)
106 return -ENOMEM;
107
108 memcpy(&priv->entry, &cdev->cbmem_entry, sizeof(priv->entry));
109
> 110 priv->remap = memremap(priv->entry.address,
111 priv->entry.entry_size, MEMREMAP_WB);
112 if (!priv->remap) {
113 err = -ENOMEM;
114 goto failure;
115 }
116
117 err = sysfs_create_group(&dev->kobj, &cb_mem_attr_group);
118 if (err) {
119 dev_err(dev, "failed to create sysfs attributes: %d\n", err);
> 120 memunmap(priv->remap);
121 goto failure;
122 }
123
124 dev->platform_data = priv;
125
126 return 0;
127 failure:
128 kfree(priv);
129 return err;
130 }
131
132 static int cbmem_remove(struct coreboot_device *cdev)
133 {
134 struct device *dev = &cdev->dev;
135 const struct cb_priv *priv;
136
137 priv = (const struct cb_priv *)dev_get_platdata(dev);
138
139 sysfs_remove_group(&dev->kobj, &cb_mem_attr_group);
140
141 if (priv)
> 142 memunmap(priv->remap);
143 kfree(priv);
144
145 dev->platform_data = NULL;
146
147 return 0;
148 }
149
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org Intel Corporation
next prev parent reply other threads:[~2019-11-17 1:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 16:15 [PATCH 0/2] firmware: google: Expose coreboot tables and CBMEM patrick.rudolph
2019-11-15 16:15 ` [PATCH 1/2] firmware: google: Expose CBMEM over sysfs patrick.rudolph
2019-11-16 13:36 ` Greg Kroah-Hartman
2019-11-17 1:18 ` kbuild test robot [this message]
2019-11-15 16:15 ` [PATCH 2/2] firmware: google: Expose coreboot tables " patrick.rudolph
2019-11-15 22:23 ` [PATCH 0/2] firmware: google: Expose coreboot tables and CBMEM Stephen Boyd
-- strict thread matches above, loose matches on Subject: below --
2019-11-20 13:39 patrick.rudolph
2019-11-20 13:39 ` [PATCH 1/2] firmware: google: Expose CBMEM over sysfs patrick.rudolph
2019-11-20 14:02 ` Greg Kroah-Hartman
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=201911170909.p3H1NF75%lkp@intel.com \
--to=lkp@intel.com \
--cc=alexios.zavras@intel.com \
--cc=allison@lohutok.net \
--cc=coreboot@coreboot.org \
--cc=gregkh@linuxfoundation.org \
--cc=jwerner@chromium.org \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patrick.rudolph@9elements.com \
--cc=samuel@sholland.org \
--cc=swboyd@chromium.org \
--cc=tglx@linutronix.de \
/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