All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [jic23-iio:testing 196/247] drivers/iio/adc/ingenic-x1600-adc.c:119 x1600_adc_read_raw_channel() warn: subtract is higher precedence than shift
Date: Mon, 09 Nov 2026 14:12:26 +0100	[thread overview]
Message-ID: <202611091401.bBwOPdXb-lkp@intel.com> (raw)

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: Olivier Louvignes <olivier@mgcrea.io>
CC: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
CC: Joshua Crofts <joshua.crofts1@gmail.com>
CC: Andy Shevchenko <andriy.shevchenko@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head:   b70566610b48ba49dec636019da4d696db64b085
commit: 6abd2c32aed66a36992c2c0bdb45cf82bf5e42df [196/247] iio: adc: Add a driver for the Ingenic X1600 ADC
:::::: branch date: 17 hours ago
:::::: commit date: 2 days ago
config: xtensa-randconfig-2200-20261109 (https://download.01.org/0day-ci/archive/20261109/202611091401.bBwOPdXb-lkp@intel.com/config)
compiler: xtensa-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/202611091401.bBwOPdXb-lkp@intel.com/

smatch warnings:
drivers/iio/adc/ingenic-x1600-adc.c:119 x1600_adc_read_raw_channel() warn: subtract is higher precedence than shift
drivers/iio/adc/ingenic-x1600-adc.c:119 x1600_adc_read_raw_channel() warn: subtract is higher precedence than shift
drivers/iio/adc/ingenic-x1600-adc.c:119 x1600_adc_read_raw_channel() warn: subtract is higher precedence than shift
drivers/iio/adc/ingenic-x1600-adc.c:119 x1600_adc_read_raw_channel() warn: subtract is higher precedence than shift

vim +119 drivers/iio/adc/ingenic-x1600-adc.c

6abd2c32aed66a Olivier Louvignes 2026-11-06   91  
6abd2c32aed66a Olivier Louvignes 2026-11-06   92  static int x1600_adc_read_raw_channel(struct x1600_adc *adc, unsigned int ch, int *val)
6abd2c32aed66a Olivier Louvignes 2026-11-06   93  {
6abd2c32aed66a Olivier Louvignes 2026-11-06   94  	unsigned int bank, shift;
6abd2c32aed66a Olivier Louvignes 2026-11-06   95  	u32 enable, data;
6abd2c32aed66a Olivier Louvignes 2026-11-06   96  	int ret;
6abd2c32aed66a Olivier Louvignes 2026-11-06   97  
6abd2c32aed66a Olivier Louvignes 2026-11-06   98  	guard(mutex)(&adc->lock);
6abd2c32aed66a Olivier Louvignes 2026-11-06   99  
6abd2c32aed66a Olivier Louvignes 2026-11-06  100  	reinit_completion(&adc->done);
6abd2c32aed66a Olivier Louvignes 2026-11-06  101  	x1600_adc_write(adc, X1600_ADC_REG_STATUS, BIT(ch));
6abd2c32aed66a Olivier Louvignes 2026-11-06  102  	enable = x1600_adc_read(adc, X1600_ADC_REG_ENABLE);
6abd2c32aed66a Olivier Louvignes 2026-11-06  103  	x1600_adc_write(adc, X1600_ADC_REG_ENABLE, enable | BIT(ch));
6abd2c32aed66a Olivier Louvignes 2026-11-06  104  
6abd2c32aed66a Olivier Louvignes 2026-11-06  105  	if (wait_for_completion_timeout(&adc->done, X1600_ADC_TIMEOUT))
6abd2c32aed66a Olivier Louvignes 2026-11-06  106  		ret = 0;
6abd2c32aed66a Olivier Louvignes 2026-11-06  107  	else
6abd2c32aed66a Olivier Louvignes 2026-11-06  108  		ret = -ETIMEDOUT;
6abd2c32aed66a Olivier Louvignes 2026-11-06  109  
6abd2c32aed66a Olivier Louvignes 2026-11-06  110  	enable = x1600_adc_read(adc, X1600_ADC_REG_ENABLE);
6abd2c32aed66a Olivier Louvignes 2026-11-06  111  	x1600_adc_write(adc, X1600_ADC_REG_ENABLE, enable & ~BIT(ch));
6abd2c32aed66a Olivier Louvignes 2026-11-06  112  	if (ret)
6abd2c32aed66a Olivier Louvignes 2026-11-06  113  		return ret;
6abd2c32aed66a Olivier Louvignes 2026-11-06  114  
6abd2c32aed66a Olivier Louvignes 2026-11-06  115  	/* Two results to a data register, the even channel's in the low half. */
6abd2c32aed66a Olivier Louvignes 2026-11-06  116  	bank = ch / 2;
6abd2c32aed66a Olivier Louvignes 2026-11-06  117  	shift = ch % 2;
6abd2c32aed66a Olivier Louvignes 2026-11-06  118  	data = x1600_adc_read(adc, X1600_ADC_REG_DATA(bank));
6abd2c32aed66a Olivier Louvignes 2026-11-06 @119  	*val = field_get(X1600_ADC_DATA_MASK(shift), data);
6abd2c32aed66a Olivier Louvignes 2026-11-06  120  
6abd2c32aed66a Olivier Louvignes 2026-11-06  121  	return 0;
6abd2c32aed66a Olivier Louvignes 2026-11-06  122  }
6abd2c32aed66a Olivier Louvignes 2026-11-06  123  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-11-09 13:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202611091401.bBwOPdXb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@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.