* Re: [PATCH RFT/RFC 1/2] gpiolib: support "undefined" GPIO machine lookup
[not found] <20251119-cs42l43-gpio-lookup-v1-1-029b1d9e1843@linaro.org>
@ 2025-11-19 19:30 ` kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-11-19 19:30 UTC (permalink / raw)
To: Bartosz Golaszewski; +Cc: llvm, oe-kbuild-all
Hi Bartosz,
[This is a private test report for your RFC patch.]
kernel test robot noticed the following build errors:
[auto build test ERROR on fe4d0dea039f2befb93f27569593ec209843b0f5]
url: https://github.com/intel-lab-lkp/linux/commits/Bartosz-Golaszewski/gpiolib-support-undefined-GPIO-machine-lookup/20251119-233054
base: fe4d0dea039f2befb93f27569593ec209843b0f5
patch link: https://lore.kernel.org/r/20251119-cs42l43-gpio-lookup-v1-1-029b1d9e1843%40linaro.org
patch subject: [PATCH RFT/RFC 1/2] gpiolib: support "undefined" GPIO machine lookup
config: loongarch-allnoconfig (https://download.01.org/0day-ci/archive/20251120/202511200320.9ITKS8Am-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 0bba1e76581bad04e7d7f09f5115ae5e2989e0d9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251120/202511200320.9ITKS8Am-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511200320.9ITKS8Am-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> drivers/gpio/gpiolib.c:4560:25: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
4560 | if (p->key == PTR_ERR(-ENOENT))
| ^~~~~~~
include/linux/err.h:63:61: note: passing argument to parameter 'ptr' here
63 | static inline long __must_check PTR_ERR(__force const void *ptr)
| ^
>> drivers/gpio/gpiolib.c:4560:14: warning: comparison between pointer and integer ('const char *' and 'long') [-Wpointer-integer-compare]
4560 | if (p->key == PTR_ERR(-ENOENT))
| ~~~~~~ ^ ~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
vim +4560 drivers/gpio/gpiolib.c
4536
4537 static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
4538 unsigned int idx, unsigned long *flags)
4539 {
4540 struct gpio_desc *desc = ERR_PTR(-ENOENT);
4541 struct gpiod_lookup_table *table;
4542 struct gpiod_lookup *p;
4543 struct gpio_chip *gc;
4544
4545 guard(mutex)(&gpio_lookup_lock);
4546
4547 table = gpiod_find_lookup_table(dev);
4548 if (!table)
4549 return desc;
4550
4551 for (p = &table->table[0]; p->key; p++) {
4552 /* idx must always match exactly */
4553 if (p->idx != idx)
4554 continue;
4555
4556 /* If the lookup entry has a con_id, require exact match */
4557 if (p->con_id && (!con_id || strcmp(p->con_id, con_id)))
4558 continue;
4559
> 4560 if (p->key == PTR_ERR(-ENOENT))
4561 return ERR_PTR(-ENOENT);
4562
4563 if (p->chip_hwnum == U16_MAX) {
4564 desc = gpio_name_to_desc(p->key);
4565 if (desc) {
4566 *flags = p->flags;
4567 return desc;
4568 }
4569
4570 dev_warn(dev, "cannot find GPIO line %s, deferring\n",
4571 p->key);
4572 return ERR_PTR(-EPROBE_DEFER);
4573 }
4574
4575 struct gpio_device *gdev __free(gpio_device_put) =
4576 gpio_device_find_by_label(p->key);
4577 if (!gdev) {
4578 /*
4579 * As the lookup table indicates a chip with
4580 * p->key should exist, assume it may
4581 * still appear later and let the interested
4582 * consumer be probed again or let the Deferred
4583 * Probe infrastructure handle the error.
4584 */
4585 dev_warn(dev, "cannot find GPIO chip %s, deferring\n",
4586 p->key);
4587 return ERR_PTR(-EPROBE_DEFER);
4588 }
4589
4590 gc = gpio_device_get_chip(gdev);
4591
4592 if (gc->ngpio <= p->chip_hwnum) {
4593 dev_err(dev,
4594 "requested GPIO %u (%u) is out of range [0..%u] for chip %s\n",
4595 idx, p->chip_hwnum, gc->ngpio - 1,
4596 gc->label);
4597 return ERR_PTR(-EINVAL);
4598 }
4599
4600 desc = gpio_device_get_desc(gdev, p->chip_hwnum);
4601 *flags = p->flags;
4602
4603 return desc;
4604 }
4605
4606 return desc;
4607 }
4608
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread