* [jic23-iio:testing 282/283] drivers/iio/adc/ti-ads112c14.c:412 ads112c14_gpio_get_direction() warn: subtract is higher precedence than shift
@ 2026-11-15 2:37 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-15 2:37 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: "David Lechner (TI)" <dlechner@baylibre.com>
CC: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
CC: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head: 3188a89c2608538435bba0d32a472422291c4792
commit: 9c53dce4b5e9b9b5b44393729c7867582a92132d [282/283] iio: adc: ti-ads112c14: add gpio support
:::::: branch date: 3 hours ago
:::::: commit date: 4 hours ago
config: m68k-randconfig-2200-20261115 (https://download.01.org/0day-ci/archive/20261115/202611150351.IEyI2faZ-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 8.5.0
smatch: v0.5.0-9187-g5189e3fb
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202611150351.IEyI2faZ-lkp@intel.com/
New smatch warnings:
drivers/iio/adc/ti-ads112c14.c:412 ads112c14_gpio_get_direction() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:412 ads112c14_gpio_get_direction() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:412 ads112c14_gpio_get_direction() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:412 ads112c14_gpio_get_direction() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:431 ads112c14_gpio_direction_input() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:431 ads112c14_gpio_direction_input() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:431 ads112c14_gpio_direction_input() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:431 ads112c14_gpio_direction_input() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:450 ads112c14_gpio_direction_output() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:450 ads112c14_gpio_direction_output() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:450 ads112c14_gpio_direction_output() warn: subtract is higher precedence than shift
drivers/iio/adc/ti-ads112c14.c:450 ads112c14_gpio_direction_output() warn: subtract is higher precedence than shift
Old smatch warnings:
include/linux/iio/iio.h:788 class___priv__iio_dev_mode_lock_try_direct_constructor() warn: passing zero to 'ERR_PTR'
vim +412 drivers/iio/adc/ti-ads112c14.c
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 400)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 401) static int ads112c14_gpio_get_direction(struct gpio_chip *gc, unsigned int offset)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 402) {
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 403) struct iio_dev *indio_dev = gpiochip_get_data(gc);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 404) struct ads112c14_data *data = iio_priv(indio_dev);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 405) unsigned int reg_val;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 406) int ret;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 407)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 408) ret = regmap_read(data->regmap, ADS112C14_REG_GPIO_CFG, ®_val);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 409) if (ret)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 410) return ret;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 411)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 @412) switch (field_get(ADS112C14_GPIO_CFG_GPIO_CFG(offset), reg_val)) {
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 413) case ADS112C14_GPIO_CFG_GPIO_CFG_INPUT:
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 414) return GPIO_LINE_DIRECTION_IN;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 415) case ADS112C14_GPIO_CFG_GPIO_CFG_OUTPUT_PUSH_PULL:
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 416) case ADS112C14_GPIO_CFG_GPIO_CFG_OUTPUT_OPEN_DRAIN:
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 417) return GPIO_LINE_DIRECTION_OUT;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 418) default:
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 419) return -EINVAL;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 420) }
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 421) }
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 422)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 423) static int ads112c14_gpio_direction_input(struct gpio_chip *gc,
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 424) unsigned int offset)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 425) {
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 426) struct iio_dev *indio_dev = gpiochip_get_data(gc);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 427) struct ads112c14_data *data = iio_priv(indio_dev);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 428)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 429) return regmap_update_bits(data->regmap, ADS112C14_REG_GPIO_CFG,
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 430) ADS112C14_GPIO_CFG_GPIO_CFG(offset),
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 @431) field_prep(ADS112C14_GPIO_CFG_GPIO_CFG(offset),
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 432) ADS112C14_GPIO_CFG_GPIO_CFG_INPUT));
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 433) }
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 434)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 435) static int ads112c14_gpio_direction_output(struct gpio_chip *gc,
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 436) unsigned int offset, int value)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 437) {
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 438) struct iio_dev *indio_dev = gpiochip_get_data(gc);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 439) struct ads112c14_data *data = iio_priv(indio_dev);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 440) int ret;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 441)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 442) ret = regmap_assign_bits(data->regmap, ADS112C14_REG_GPIO_DATA_OUTPUT,
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 443) ADS112C14_GPIO_DATA_OUTPUT_GPIO_DAT_OUT(offset),
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 444) value);
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 445) if (ret)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 446) return ret;
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 447)
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 448) return regmap_update_bits(data->regmap, ADS112C14_REG_GPIO_CFG,
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 449) ADS112C14_GPIO_CFG_GPIO_CFG(offset),
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 @450) field_prep(ADS112C14_GPIO_CFG_GPIO_CFG(offset),
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 451) ADS112C14_GPIO_CFG_GPIO_CFG_OUTPUT_PUSH_PULL));
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 452) }
9c53dce4b5e9b9 David Lechner (TI 2026-11-06 453)
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-15 2:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-15 2:37 [jic23-iio:testing 282/283] drivers/iio/adc/ti-ads112c14.c:412 ads112c14_gpio_get_direction() warn: subtract is higher precedence than shift kernel test robot
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.