Re: [PATCH 2/3] thermal/int340x_thermal: Export OEM vendor variables

From: kbuild test robot
Date: Mon Apr 13 2020 - 20:09:51 EST


Hi Matthew,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on linux/master soc-thermal/next v5.7-rc1 next-20200413]
[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/Matthew-Garrett/thermal-int340x_thermal-Export-GDDV/20200414-052440
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 8f3d9f354286745c751374f5f1fcafee6b3f3136
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386

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

All errors (new ones prefixed by >>):

In file included from include/linux/kobject.h:20:0,
from include/linux/module.h:20,
from drivers/thermal/intel/int340x_thermal/int3400_thermal.c:9:
drivers/thermal/intel/int340x_thermal/int3400_thermal.c: In function 'evaluate_odvp':
>> drivers/thermal/intel/int340x_thermal/int3400_thermal.c:298:20: error: 'attr' undeclared (first use in this function); did you mean 'iattr'?
sysfs_attr_init(attr->attr);
^
include/linux/sysfs.h:55:3: note: in definition of macro 'sysfs_attr_init'
(attr)->key = &__key; \
^~~~
drivers/thermal/intel/int340x_thermal/int3400_thermal.c:298:20: note: each undeclared identifier is reported only once for each function it appears in
sysfs_attr_init(attr->attr);
^
include/linux/sysfs.h:55:3: note: in definition of macro 'sysfs_attr_init'
(attr)->key = &__key; \
^~~~

vim +298 drivers/thermal/intel/int340x_thermal/int3400_thermal.c

257
258 static int evaluate_odvp(struct int3400_thermal_priv *priv)
259 {
260 struct acpi_buffer odvp = { ACPI_ALLOCATE_BUFFER, NULL };
261 union acpi_object *obj = NULL;
262 acpi_status status;
263 int i, ret;
264
265 status = acpi_evaluate_object(priv->adev->handle, "ODVP", NULL, &odvp);
266 if (ACPI_FAILURE(status)) {
267 ret = -EINVAL;
268 goto out_err;
269 }
270
271 obj = odvp.pointer;
272 if (obj->type != ACPI_TYPE_PACKAGE) {
273 ret = -EINVAL;
274 goto out_err;
275 }
276
277 if (priv->odvp == NULL) {
278 priv->odvp_count = obj->package.count;
279 priv->odvp = kmalloc_array(priv->odvp_count, sizeof(int),
280 GFP_KERNEL);
281 if (!priv->odvp) {
282 ret = -ENOMEM;
283 goto out_err;
284 }
285 }
286
287 if (priv->odvp_attrs == NULL) {
288 priv->odvp_attrs = kcalloc(priv->odvp_count,
289 sizeof(struct odvp_attr),
290 GFP_KERNEL);
291 if (!priv->odvp_attrs) {
292 ret = -ENOMEM;
293 goto out_err;
294 }
295 for (i = 0; i < priv->odvp_count; i++) {
296 struct odvp_attr *odvp = &priv->odvp_attrs[i];
297
> 298 sysfs_attr_init(attr->attr);
299 odvp->priv = priv;
300 odvp->odvp = i;
301 odvp->attr.attr.name = kasprintf(GFP_KERNEL,
302 "odvp%d", i);
303
304 if (!odvp->attr.attr.name) {
305 ret = -ENOMEM;
306 goto out_err;
307 }
308 odvp->attr.attr.mode = 0444;
309 odvp->attr.show = odvp_show;
310 odvp->attr.store = NULL;
311 ret = sysfs_create_file(&priv->pdev->dev.kobj,
312 &odvp->attr.attr);
313 if (ret)
314 goto out_err;
315 }
316 }
317
318 for (i = 0; i < obj->package.count; i++) {
319 if (obj->package.elements[i].type == ACPI_TYPE_INTEGER)
320 priv->odvp[i] = obj->package.elements[i].integer.value;
321 }
322
323 kfree(obj);
324 return 0;
325
326 out_err:
327 cleanup_odvp(priv);
328 kfree(obj);
329 return ret;
330 }
331

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

Attachment: .config.gz
Description: application/gzip