All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH RFT/RFC 1/2] gpiolib: support "undefined" GPIO machine lookup
Date: Thu, 20 Nov 2025 00:43:46 +0800	[thread overview]
Message-ID: <202511200043.AUTK7uH5-lkp@intel.com> (raw)
In-Reply-To: <20251119-cs42l43-gpio-lookup-v1-1-029b1d9e1843@linaro.org>

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: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20251120/202511200043.AUTK7uH5-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251120/202511200043.AUTK7uH5-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/202511200043.AUTK7uH5-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/gpio/gpiolib.c: In function 'gpiod_find':
>> drivers/gpio/gpiolib.c:4560:39: error: passing argument 1 of 'PTR_ERR' makes pointer from integer without a cast [-Wint-conversion]
    4560 |                 if (p->key == PTR_ERR(-ENOENT))
   In file included from include/linux/cleanup.h:6,
                    from include/linux/preempt.h:11,
                    from include/linux/spinlock.h:56,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/slab.h:16,
                    from include/linux/resource_ext.h:11,
                    from include/linux/acpi.h:13,
                    from drivers/gpio/gpiolib.c:3:
   include/linux/err.h:63:61: note: expected 'const void *' but argument is of type 'int'
      63 | static inline long __must_check PTR_ERR(__force const void *ptr)
         |                                                 ~~~~~~~~~~~~^~~
>> drivers/gpio/gpiolib.c:4560:28: warning: comparison between pointer and integer
    4560 |                 if (p->key == PTR_ERR(-ENOENT))
         |                            ^~


vim +/PTR_ERR +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

  reply	other threads:[~2025-11-19 16:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 15:21 [PATCH RFT/RFC 0/2] mfd: cs42l43: fix GPIO lookup for chip selects Bartosz Golaszewski
2025-11-19 15:21 ` [PATCH RFT/RFC 1/2] gpiolib: support "undefined" GPIO machine lookup Bartosz Golaszewski
2025-11-19 16:43   ` kernel test robot [this message]
2025-11-19 16:49   ` Bartosz Golaszewski
2025-11-19 19:30   ` kernel test robot
2025-11-19 15:21 ` [PATCH RFT/RFC 2/2] mfd: cs42l43: use GPIO machine lookup for cs-gpios Bartosz Golaszewski
2025-11-19 15:35   ` Bartosz Golaszewski
2025-11-19 15:52     ` Charles Keepax
2025-11-19 16:13       ` Charles Keepax
2025-11-19 16:28       ` Bartosz Golaszewski
2025-11-19 16:43         ` Charles Keepax

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202511200043.AUTK7uH5-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brgl@bgdev.pl \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.