[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202501101656.F268NchW-lkp@intel.com>
Date: Fri, 10 Jan 2025 17:14:43 +0800
From: kernel test robot <lkp@...el.com>
To: Antoni Pokusinski <apokusinski01@...il.com>, jic23@...nel.org,
lars@...afoo.de, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, andrej.skvortzov@...il.com,
neil.armstrong@...aro.org, icenowy@...c.io, megi@....cz,
danila@...xyga.com, javier.carrasco.cruz@...il.com, and@...nel.org
Cc: oe-kbuild-all@...ts.linux.dev, apokusinski01@...il.com,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v2 2/2] iio: magnetometer: si7210: add driver for Si7210
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@...el.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
Powered by blists - more mailing lists