From: kernel test robot <lkp@intel.com>
To: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
Chen-Yu Tsai <wens@csie.org>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: drivers/iio/adc/axp20x_adc.c:572:26: sparse: sparse: dubious: x & !y
Date: Thu, 11 Jan 2024 01:53:40 +0800 [thread overview]
Message-ID: <202401110159.j4qEZUPp-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ab27740f76654ed58dd32ac0ba0031c18a6dea3b
commit: 8957e5344353e9cd3f6b1e3004942e35449fa0e8 iio: adc: axp20x_adc: Minor code cleanups
date: 10 months ago
config: csky-buildonly-randconfig-r006-20230413 (https://download.01.org/0day-ci/archive/20240111/202401110159.j4qEZUPp-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20240111/202401110159.j4qEZUPp-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/202401110159.j4qEZUPp-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/iio/adc/axp20x_adc.c:572:26: sparse: sparse: dubious: x & !y
drivers/iio/adc/axp20x_adc.c:577:26: sparse: sparse: dubious: x & !y
drivers/iio/adc/axp20x_adc.c: note: in included file (through include/linux/mmzone.h, include/linux/topology.h, include/linux/irq.h, ...):
include/linux/page-flags.h:246:46: sparse: sparse: self-comparison always evaluates to false
vim +572 drivers/iio/adc/axp20x_adc.c
551
552 static int axp20x_write_raw(struct iio_dev *indio_dev,
553 struct iio_chan_spec const *chan, int val, int val2,
554 long mask)
555 {
556 struct axp20x_adc_iio *info = iio_priv(indio_dev);
557 unsigned int regmask, regval;
558
559 /*
560 * The AXP20X PMIC allows the user to choose between 0V and 0.7V offsets
561 * for (independently) GPIO0 and GPIO1 when in ADC mode.
562 */
563 if (mask != IIO_CHAN_INFO_OFFSET)
564 return -EINVAL;
565
566 if (val != 0 && val != 700000)
567 return -EINVAL;
568
569 switch (chan->channel) {
570 case AXP20X_GPIO0_V:
571 regmask = AXP20X_GPIO10_IN_RANGE_GPIO0;
> 572 regval = FIELD_PREP(AXP20X_GPIO10_IN_RANGE_GPIO0, !!val);
573 break;
574
575 case AXP20X_GPIO1_V:
576 regmask = AXP20X_GPIO10_IN_RANGE_GPIO1;
577 regval = FIELD_PREP(AXP20X_GPIO10_IN_RANGE_GPIO1, !!val);
578 break;
579
580 default:
581 return -EINVAL;
582 }
583
584 return regmap_update_bits(info->regmap, AXP20X_GPIO10_IN_RANGE, regmask, regval);
585 }
586
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-01-10 17:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 17:53 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-01-07 1:28 kernel test robot
2024-01-07 5:37 ` Chen-Yu Tsai
2024-01-07 19:46 ` Andy Shevchenko
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=202401110159.j4qEZUPp-lkp@intel.com \
--to=lkp@intel.com \
--cc=Jonathan.Cameron@huawei.com \
--cc=aidanmacdonald.0x0@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=wens@csie.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®