Content-Type: multipart/mixed; boundary="===============3465900663606863229==" MIME-Version: 1.0 From: kbuild test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH 1/2] firmware: google: Expose CBMEM over sysfs Date: Sun, 17 Nov 2019 09:18:33 +0800 Message-ID: <201911170909.p3H1NF75%lkp@intel.com> In-Reply-To: <20191115161524.23738-2-patrick.rudolph@9elements.com> List-Id: --===============3465900663606863229== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 h= elp 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/37406= 982] 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=3Dx86_64 allmodconfig make C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' If you fix the issue, kindly add following tag Reported-by: kbuild test robot sparse warnings: (new ones prefixed by >>) >> drivers/firmware/google/cbmem-coreboot.c:79:44: sparse: sparse: incorrec= t type in argument 4 (different address spaces) @@ expected void const *= from @@ got void [noderef] > drivers/firmware/google/cbmem-coreboot.c:79:44: sparse: expected void= const *from >> drivers/firmware/google/cbmem-coreboot.c:79:44: sparse: got void [nod= eref] *const remap >> drivers/firmware/google/cbmem-coreboot.c:110:21: sparse: sparse: incorre= ct type in assignment (different address spaces) @@ expected void [noder= ef] *remap @@ got n:2> *remap @@ >> drivers/firmware/google/cbmem-coreboot.c:110:21: sparse: expected voi= d [noderef] *remap >> drivers/firmware/google/cbmem-coreboot.c:110:21: sparse: got void * >> drivers/firmware/google/cbmem-coreboot.c:120:30: sparse: sparse: incorre= ct type in argument 1 (different address spaces) @@ expected void *addr = @@ got void [noderef] > drivers/firmware/google/cbmem-coreboot.c:120:30: sparse: expected voi= d *addr >> drivers/firmware/google/cbmem-coreboot.c:120:30: sparse: got void [no= deref] *remap >> drivers/firmware/google/cbmem-coreboot.c:142:30: sparse: sparse: incorre= ct type in argument 1 (different address spaces) @@ expected void *addr = @@ got void [noderef] *void *addr @@ drivers/firmware/google/cbmem-coreboot.c:142:30: sparse: expected voi= d *addr drivers/firmware/google/cbmem-coreboot.c:142:30: sparse: got void [no= deref] *const remap vim +79 drivers/firmware/google/cbmem-coreboot.c 68 = 69 static ssize_t cbmem_data_read(struct file *filp, struct kobject *ko= bj, 70 struct bin_attribute *bin_attr, 71 char *buffer, loff_t offset, size_t count) 72 { 73 struct device *dev =3D kobj_to_dev(kobj); 74 const struct cb_priv *priv; 75 = 76 priv =3D (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 =3D { 83 .attr =3D { .name =3D "data", .mode =3D 0444 }, 84 .read =3D cbmem_data_read, 85 }; 86 = 87 static struct bin_attribute *cb_mem_bin_attrs[] =3D { 88 &coreboot_attr_data, 89 NULL 90 }; 91 = 92 static struct attribute_group cb_mem_attr_group =3D { 93 .name =3D "cbmem_attributes", 94 .attrs =3D cb_mem_attrs, 95 .bin_attrs =3D cb_mem_bin_attrs, 96 }; 97 = 98 static int cbmem_probe(struct coreboot_device *cdev) 99 { 100 struct device *dev =3D &cdev->dev; 101 struct cb_priv *priv; 102 int err; 103 = 104 priv =3D 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 =3D memremap(priv->entry.address, 111 priv->entry.entry_size, MEMREMAP_WB); 112 if (!priv->remap) { 113 err =3D -ENOMEM; 114 goto failure; 115 } 116 = 117 err =3D 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 =3D 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 =3D &cdev->dev; 135 const struct cb_priv *priv; 136 = 137 priv =3D (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 =3D NULL; 146 = 147 return 0; 148 } 149 = --- 0-DAY kernel test infrastructure Open Source Technology Cen= ter https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corpor= ation --===============3465900663606863229==--