Re: [PATCH] gpio: twl4030: Use guard(mutex)() over manual locking
From: kernel test robot
Date: Wed May 13 2026 - 15:34:30 EST
Hi Maxwell,
kernel test robot noticed the following build warnings:
[auto build test WARNING on brgl/gpio/for-next]
[also build test WARNING on linus/master v7.1-rc3 next-20260508]
[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/Maxwell-Doose/gpio-twl4030-Use-guard-mutex-over-manual-locking/20260513-231548
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20260502210354.160439-1-m32285159%40gmail.com
patch subject: [PATCH] gpio: twl4030: Use guard(mutex)() over manual locking
config: arc-randconfig-002-20260514 (https://download.01.org/0day-ci/archive/20260514/202605140349.KZOdtI2I-lkp@xxxxxxxxx/config)
compiler: arc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140349.KZOdtI2I-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605140349.KZOdtI2I-lkp@xxxxxxxxx/
All warnings (new ones prefixed by >>):
drivers/gpio/gpio-twl4030.c: In function 'twl_get':
>> drivers/gpio/gpio-twl4030.c:310:6: warning: unused variable 'ret' [-Wunused-variable]
int ret;
^~~
vim +/ret +310 drivers/gpio/gpio-twl4030.c
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 306
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 307 static int twl_get(struct gpio_chip *chip, unsigned offset)
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 308 {
231a8680b78260f drivers/gpio/gpio-twl4030.c Linus Walleij 2015-12-07 309 struct gpio_twl4030_priv *priv = gpiochip_get_data(chip);
c111feabe2e200b drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-20 @310 int ret;
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 311 int status = 0;
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 312
b833f746820a65c drivers/gpio/gpio-twl4030.c Maxwell Doose 2026-05-02 313 guard(mutex)(&priv->mutex);
c111feabe2e200b drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-20 314 if (!(priv->usage_count & BIT(offset))) {
b833f746820a65c drivers/gpio/gpio-twl4030.c Maxwell Doose 2026-05-02 315 return -EPERM;
c111feabe2e200b drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-20 316 }
72c7901ef00925c drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-06 317
c111feabe2e200b drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-20 318 if (priv->direction & BIT(offset))
c111feabe2e200b drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-20 319 status = priv->out_state & BIT(offset);
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 320 else
c111feabe2e200b drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-20 321 status = twl4030_get_gpio_datain(offset);
72c7901ef00925c drivers/gpio/gpio-twl4030.c Peter Ujfalusi 2012-12-06 322
b833f746820a65c drivers/gpio/gpio-twl4030.c Maxwell Doose 2026-05-02 323 return (status < 0) ? status : !!status;
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 324 }
e9d359471dfed51 drivers/gpio/twl4030-gpio.c David Brownell 2008-10-20 325
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki