All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Antoni Pokusinski <apokusinski01@gmail.com>,
	jic23@kernel.org, lars@metafoo.de, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	andrej.skvortzov@gmail.com, neil.armstrong@linaro.org,
	icenowy@aosc.io, megi@xff.cz, danila@jiaxyga.com,
	javier.carrasco.cruz@gmail.com, and@kernel.org
Cc: oe-kbuild-all@lists.linux.dev, apokusinski01@gmail.com,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] iio: magnetometer: si7210: add driver for Si7210
Date: Fri, 10 Jan 2025 17:14:43 +0800	[thread overview]
Message-ID: <202501101656.F268NchW-lkp@intel.com> (raw)
In-Reply-To: <20250108234411.882768-3-apokusinski01@gmail.com>

Hi Antoni,

kernel test robot noticed the following build warnings:

[auto build test WARNING on jic23-iio/togreg]
[also build test WARNING on linus/master v6.13-rc6 next-20250110]
[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/Antoni-Pokusinski/dt-bindings-iio-magnetometer-add-binding-for-Si7210/20250109-074641
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
patch link:    https://lore.kernel.org/r/20250108234411.882768-3-apokusinski01%40gmail.com
patch subject: [PATCH v2 2/2] iio: magnetometer: si7210: add driver for Si7210
config: openrisc-randconfig-r123-20250110 (https://download.01.org/0day-ci/archive/20250110/202501101656.F268NchW-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 14.2.0
reproduce: (https://download.01.org/0day-ci/archive/20250110/202501101656.F268NchW-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/202501101656.F268NchW-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/iio/magnetometer/si7210.c:169:16: sparse: sparse: cast from restricted __be16
>> drivers/iio/magnetometer/si7210.c:189:24: sparse: sparse: restricted __be16 degrades to integer
>> drivers/iio/magnetometer/si7210.c:206:23: sparse: sparse: cast to restricted __be16
   drivers/iio/magnetometer/si7210.c:206:23: sparse: sparse: restricted __be16 degrades to integer
   drivers/iio/magnetometer/si7210.c:206:23: sparse: sparse: restricted __be16 degrades to integer

vim +169 drivers/iio/magnetometer/si7210.c

   143	
   144	static int si7210_fetch_measurement(struct si7210_data *data,
   145					    struct iio_chan_spec const *chan,
   146					    __be16 *buf)
   147	{
   148		u8 dspsigsel = chan->type == IIO_MAGN ? 0 : 1;
   149		int ret;
   150	
   151		guard(mutex)(&data->fetch_lock);
   152	
   153		ret = regmap_update_bits(data->regmap, SI7210_REG_DSPSIGSEL,
   154					 SI7210_MASK_DSPSIGSEL, dspsigsel);
   155		if (ret < 0)
   156			return ret;
   157	
   158		ret = regmap_update_bits(data->regmap, SI7210_REG_POWER_CTRL,
   159					 SI7210_MASK_ONEBURST | SI7210_MASK_STOP,
   160					 SI7210_MASK_ONEBURST & ~SI7210_MASK_STOP);
   161		if (ret < 0)
   162			return ret;
   163	
   164		/* Read the contents of the registers containing the result: DSPSIGM, DSPSIGL */
   165		ret = regmap_bulk_read(data->regmap, SI7210_REG_DSPSIGM, buf, 2);
   166		if (ret < 0)
   167			return ret;
   168	
 > 169		*buf = cpu_to_be16(*buf);
   170	
   171		return 0;
   172	}
   173	
   174	static int si7210_read_raw(struct iio_dev *indio_dev,
   175				   struct iio_chan_spec const *chan,
   176				   int *val, int *val2, long mask)
   177	{
   178		struct si7210_data *data = iio_priv(indio_dev);
   179		long long tmp;
   180		__be16 dspsig;
   181		int ret;
   182	
   183		switch (mask) {
   184		case IIO_CHAN_INFO_RAW:
   185			ret = si7210_fetch_measurement(data, chan, &dspsig);
   186			if (ret < 0)
   187				return ret;
   188	
 > 189			*val = dspsig & GENMASK(14, 0);
   190			return IIO_VAL_INT;
   191		case IIO_CHAN_INFO_SCALE:
   192			*val = 0;
   193			if (data->curr_scale == 20)
   194				*val2 = 1250;
   195			else /* data->curr_scale == 200 */
   196				*val2 = 12500;
   197			return IIO_VAL_INT_PLUS_MICRO;
   198		case IIO_CHAN_INFO_OFFSET:
   199			*val = -16384;
   200			return IIO_VAL_INT;
   201		case IIO_CHAN_INFO_PROCESSED:
   202			ret = si7210_fetch_measurement(data, chan, &dspsig);
   203			if (ret < 0)
   204				return ret;
   205	
 > 206			tmp = FIELD_GET(GENMASK(14, 3), dspsig);
   207			tmp = (div_s64(-383 * tmp * tmp, 100) + (160940 * tmp - 279800000));
   208			tmp = (1 + (data->temp_gain >> 11)) * tmp + 62500 * data->temp_offset;
   209	
   210			ret = regulator_get_voltage(data->vdd);
   211			if (ret < 0)
   212				return ret;
   213	
   214			tmp -= 222 * div_s64(ret, 1000);
   215	
   216			*val = div_s64(tmp, 1000);
   217	
   218			return IIO_VAL_INT;
   219		default:
   220			return -EINVAL;
   221		}
   222	}
   223	

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

  reply	other threads:[~2025-01-10  9:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-08 23:44 [PATCH v2 0/2] iio: magnetometer: add support for Si7210 Antoni Pokusinski
2025-01-08 23:44 ` [PATCH v2 1/2] dt-bindings: iio: magnetometer: add binding " Antoni Pokusinski
2025-01-10  9:21   ` Krzysztof Kozlowski
2025-01-08 23:44 ` [PATCH v2 2/2] iio: magnetometer: si7210: add driver " Antoni Pokusinski
2025-01-10  9:14   ` kernel test robot [this message]
2025-01-10 16:12   ` Christophe JAILLET
2025-01-10 22:51   ` kernel test robot

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=202501101656.F268NchW-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=and@kernel.org \
    --cc=andrej.skvortzov@gmail.com \
    --cc=apokusinski01@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=danila@jiaxyga.com \
    --cc=devicetree@vger.kernel.org \
    --cc=icenowy@aosc.io \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jic23@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=megi@xff.cz \
    --cc=neil.armstrong@linaro.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=robh@kernel.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 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.