mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrew Ijano <andrew.ijano@gmail.com>, jic23@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, andrew.lopes@alumni.usp.br,
	gustavobastos@usp.br, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, jstephan@baylibre.com,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] iio: accel: sca3000: replace usages of internal read data helpers by spi helpers
Date: Sat, 10 May 2025 06:58:21 +0800	[thread overview]
Message-ID: <202505100631.nlBOlbYm-lkp@intel.com> (raw)
In-Reply-To: <20250509013931.47524-1-andrew.lopes@alumni.usp.br>

Hi Andrew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.15-rc5 next-20250509]
[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/Andrew-Ijano/iio-accel-sca3000-replace-usages-of-internal-read-data-helpers-by-spi-helpers/20250509-094127
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20250509013931.47524-1-andrew.lopes%40alumni.usp.br
patch subject: [PATCH v3] iio: accel: sca3000: replace usages of internal read data helpers by spi helpers
config: i386-randconfig-r123-20250510 (https://download.01.org/0day-ci/archive/20250510/202505100631.nlBOlbYm-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250510/202505100631.nlBOlbYm-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/202505100631.nlBOlbYm-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/iio/accel/sca3000.c:745:46: sparse: sparse: cast to restricted __be16
   drivers/iio/accel/sca3000.c:756:33: sparse: sparse: cast to restricted __be16

vim +745 drivers/iio/accel/sca3000.c

   720	
   721	static int sca3000_read_raw(struct iio_dev *indio_dev,
   722				    struct iio_chan_spec const *chan,
   723				    int *val,
   724				    int *val2,
   725				    long mask)
   726	{
   727		struct sca3000_state *st = iio_priv(indio_dev);
   728		int ret;
   729		u8 address;
   730	
   731		switch (mask) {
   732		case IIO_CHAN_INFO_RAW:
   733			mutex_lock(&st->lock);
   734			if (chan->type == IIO_ACCEL) {
   735				if (st->mo_det_use_count) {
   736					mutex_unlock(&st->lock);
   737					return -EBUSY;
   738				}
   739				address = sca3000_addresses[chan->address][0];
   740				ret = spi_w8r16(st->us, SCA3000_READ_REG(address));
   741				if (ret < 0) {
   742					mutex_unlock(&st->lock);
   743					return ret;
   744				}
 > 745				*val = sign_extend32(be16_to_cpu((__be16) ret) >>
   746						     chan->scan_type.shift,
   747						     chan->scan_type.realbits - 1);
   748			} else {
   749				/* get the temperature when available */
   750				ret = spi_w8r16(st->us,
   751							SCA3000_READ_REG(SCA3000_REG_TEMP_MSB_ADDR));
   752				if (ret < 0) {
   753					mutex_unlock(&st->lock);
   754					return ret;
   755				}
   756				*val = (be16_to_cpu((__be16) ret) >>
   757					chan->scan_type.shift) &
   758					GENMASK(chan->scan_type.realbits - 1, 0);
   759			}
   760			mutex_unlock(&st->lock);
   761			return IIO_VAL_INT;
   762		case IIO_CHAN_INFO_SCALE:
   763			*val = 0;
   764			if (chan->type == IIO_ACCEL)
   765				*val2 = st->info->scale;
   766			else /* temperature */
   767				*val2 = 555556;
   768			return IIO_VAL_INT_PLUS_MICRO;
   769		case IIO_CHAN_INFO_OFFSET:
   770			*val = -214;
   771			*val2 = 600000;
   772			return IIO_VAL_INT_PLUS_MICRO;
   773		case IIO_CHAN_INFO_SAMP_FREQ:
   774			mutex_lock(&st->lock);
   775			ret = sca3000_read_raw_samp_freq(st, val);
   776			mutex_unlock(&st->lock);
   777			return ret ? ret : IIO_VAL_INT;
   778		case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
   779			mutex_lock(&st->lock);
   780			ret = sca3000_read_3db_freq(st, val);
   781			mutex_unlock(&st->lock);
   782			return ret;
   783		default:
   784			return -EINVAL;
   785		}
   786	}
   787	

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

      parent reply	other threads:[~2025-05-09 22:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-09  1:38 Andrew Ijano
2025-05-09  9:06 ` Andy Shevchenko
2025-05-11 11:35   ` Jonathan Cameron
2025-05-11 17:23   ` Andrew Ijano
2025-05-09 22:58 ` kernel test robot [this message]

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=202505100631.nlBOlbYm-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew.ijano@gmail.com \
    --cc=andrew.lopes@alumni.usp.br \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gustavobastos@usp.br \
    --cc=jic23@kernel.org \
    --cc=jstephan@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --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 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®