[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202207310216.JtYAKodB-lkp@intel.com>
Date: Sun, 31 Jul 2022 02:06:50 +0800
From: kernel test robot <lkp@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-kernel@...r.kernel.org
Cc: llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
linux-media@...r.kernel.org, Yong Zhi <yong.zhi@...el.com>,
Bingbu Cao <bingbu.cao@...el.com>,
Dan Scally <djrscally@...il.com>,
Tianshu Qiu <tian.shu.qiu@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: Re: [PATCH v1 1/1] media: ipu3-cio2: Don't dereference fwnode handle
Hi Andy,
I love your patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on linus/master v5.19-rc8 next-20220728]
[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/media-ipu3-cio2-Don-t-dereference-fwnode-handle/20220730-235023
base: git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-a012 (https://download.01.org/0day-ci/archive/20220731/202207310216.JtYAKodB-lkp@intel.com/config)
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 52cd00cabf479aa7eb6dbb063b7ba41ea57bce9e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/a78ba0da9d77a8fa412604492f931b188e1114d5
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Andy-Shevchenko/media-ipu3-cio2-Don-t-dereference-fwnode-handle/20220730-235023
git checkout a78ba0da9d77a8fa412604492f931b188e1114d5
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/media/pci/intel/ipu3/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
>> drivers/media/pci/intel/ipu3/cio2-bridge.c:266:33: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct fwnode_handle *fwnode, *current;
^
arch/x86/include/asm/current.h:18:28: note: expanded from macro 'current'
#define current get_current()
^
>> drivers/media/pci/intel/ipu3/cio2-bridge.c:266:33: error: conflicting types for 'get_current'
arch/x86/include/asm/current.h:18:17: note: expanded from macro 'current'
#define current get_current()
^
arch/x86/include/asm/current.h:13:44: note: previous definition is here
static __always_inline struct task_struct *get_current(void)
^
2 errors generated.
vim +266 drivers/media/pci/intel/ipu3/cio2-bridge.c
261
262 static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
263 struct cio2_bridge *bridge,
264 struct pci_dev *cio2)
265 {
> 266 struct fwnode_handle *fwnode, *current;
267 struct cio2_sensor *sensor;
268 struct acpi_device *adev;
269 acpi_status status;
270 int ret;
271
272 for_each_acpi_dev_match(adev, cfg->hid, NULL, -1) {
273 if (!adev->status.enabled)
274 continue;
275
276 if (bridge->n_sensors >= CIO2_NUM_PORTS) {
277 acpi_dev_put(adev);
278 dev_err(&cio2->dev, "Exceeded available CIO2 ports\n");
279 return -EINVAL;
280 }
281
282 sensor = &bridge->sensors[bridge->n_sensors];
283 strscpy(sensor->name, cfg->hid, sizeof(sensor->name));
284
285 ret = cio2_bridge_read_acpi_buffer(adev, "SSDB",
286 &sensor->ssdb,
287 sizeof(sensor->ssdb));
288 if (ret)
289 goto err_put_adev;
290
291 if (sensor->ssdb.vcmtype > ARRAY_SIZE(cio2_vcm_types)) {
292 dev_warn(&adev->dev, "Unknown VCM type %d\n",
293 sensor->ssdb.vcmtype);
294 sensor->ssdb.vcmtype = 0;
295 }
296
297 status = acpi_get_physical_device_location(adev->handle, &sensor->pld);
298 if (ACPI_FAILURE(status)) {
299 ret = -ENODEV;
300 goto err_put_adev;
301 }
302
303 if (sensor->ssdb.lanes > CIO2_MAX_LANES) {
304 dev_err(&adev->dev,
305 "Number of lanes in SSDB is invalid\n");
306 ret = -EINVAL;
307 goto err_free_pld;
308 }
309
310 cio2_bridge_create_fwnode_properties(sensor, bridge, cfg);
311 cio2_bridge_create_connection_swnodes(bridge, sensor);
312
313 ret = software_node_register_nodes(sensor->swnodes);
314 if (ret)
315 goto err_free_pld;
316
317 fwnode = software_node_fwnode(&sensor->swnodes[
318 SWNODE_SENSOR_HID]);
319 if (!fwnode) {
320 ret = -ENODEV;
321 goto err_free_swnodes;
322 }
323
324 sensor->adev = acpi_dev_get(adev);
325
326 current = acpi_fwnode_handle(adev);
327 current->secondary = fwnode;
328
329 cio2_bridge_instantiate_vcm_i2c_client(sensor);
330
331 dev_info(&cio2->dev, "Found supported sensor %s\n",
332 acpi_dev_name(adev));
333
334 bridge->n_sensors++;
335 }
336
337 return 0;
338
339 err_free_swnodes:
340 software_node_unregister_nodes(sensor->swnodes);
341 err_free_pld:
342 ACPI_FREE(sensor->pld);
343 err_put_adev:
344 acpi_dev_put(adev);
345 return ret;
346 }
347
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Powered by blists - more mailing lists