[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202207081957.tSlBfZYh-lkp@intel.com>
Date: Fri, 8 Jul 2022 19:50:47 +0800
From: kernel test robot <lkp@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: kbuild-all@...ts.01.org,
Wolfram Sang <wsa-dev@...g-engineering.com>
Subject: Re: [PATCH v2 1/1] i2c: scmi: Replace open coded
device_get_match_data()
Hi Andy,
I love your patch! Perhaps something to improve:
[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on linus/master v5.19-rc5 next-20220708]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/i2c-scmi-Replace-open-coded-device_get_match_data/20220708-180449
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: i386-randconfig-a001 (https://download.01.org/0day-ci/archive/20220708/202207081957.tSlBfZYh-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/c111b5704bd215394f238fa88925d6832cf2562c
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/i2c-scmi-Replace-open-coded-device_get_match_data/20220708-180449
git checkout c111b5704bd215394f238fa88925d6832cf2562c
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/i2c/busses/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
drivers/i2c/busses/i2c-scmi.c: In function 'acpi_smbus_cmi_add':
>> drivers/i2c/busses/i2c-scmi.c:372:28: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
372 | smbus_cmi->methods = device_get_match_data(&device->dev);
| ^
>> drivers/i2c/busses/i2c-scmi.c:364:38: warning: unused variable 'id' [-Wunused-variable]
364 | const struct acpi_device_id *id;
| ^~
vim +/const +372 drivers/i2c/busses/i2c-scmi.c
360
361 static int acpi_smbus_cmi_add(struct acpi_device *device)
362 {
363 struct acpi_smbus_cmi *smbus_cmi;
> 364 const struct acpi_device_id *id;
365 int ret;
366
367 smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL);
368 if (!smbus_cmi)
369 return -ENOMEM;
370
371 smbus_cmi->handle = device->handle;
> 372 smbus_cmi->methods = device_get_match_data(&device->dev);
373 strcpy(acpi_device_name(device), ACPI_SMBUS_HC_DEVICE_NAME);
374 strcpy(acpi_device_class(device), ACPI_SMBUS_HC_CLASS);
375 device->driver_data = smbus_cmi;
376 smbus_cmi->cap_info = 0;
377 smbus_cmi->cap_read = 0;
378 smbus_cmi->cap_write = 0;
379
380 acpi_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1,
381 acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL);
382
383 if (smbus_cmi->cap_info == 0) {
384 ret = -ENODEV;
385 goto err;
386 }
387
388 snprintf(smbus_cmi->adapter.name, sizeof(smbus_cmi->adapter.name),
389 "SMBus CMI adapter %s",
390 acpi_device_name(device));
391 smbus_cmi->adapter.owner = THIS_MODULE;
392 smbus_cmi->adapter.algo = &acpi_smbus_cmi_algorithm;
393 smbus_cmi->adapter.algo_data = smbus_cmi;
394 smbus_cmi->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
395 smbus_cmi->adapter.dev.parent = &device->dev;
396
397 ret = i2c_add_adapter(&smbus_cmi->adapter);
398 if (ret) {
399 dev_err(&device->dev, "Couldn't register adapter!\n");
400 goto err;
401 }
402
403 return 0;
404
405 err:
406 kfree(smbus_cmi);
407 device->driver_data = NULL;
408 return ret;
409 }
410
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists