From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [PATCH 10/16] iio: adc: max1027: Prevent single channel accesses during buffer reads
Date: Thu, 19 Aug 2021 04:58:58 +0800 [thread overview]
Message-ID: <202108190400.0n3a9cSp-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 4547 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210818111139.330636-11-miquel.raynal@bootlin.com>
References: <20210818111139.330636-11-miquel.raynal@bootlin.com>
TO: Miquel Raynal <miquel.raynal@bootlin.com>
TO: Jonathan Cameron <jic23@kernel.org>
TO: "Lars-Peter Clausen" <lars@metafoo.de>
CC: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
CC: linux-iio(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: Miquel Raynal <miquel.raynal@bootlin.com>
Hi Miquel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on iio/togreg]
[also build test WARNING on linux/master linus/master v5.14-rc6 next-20210818]
[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]
url: https://github.com/0day-ci/linux/commits/Miquel-Raynal/Bring-software-triggers-support-to-MAX1027-like-ADCs/20210818-191619
base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: i386-randconfig-m021-20210818 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch warnings:
drivers/iio/adc/max1027.c:366 max1027_read_raw() warn: inconsistent returns '&st->lock'.
vim +366 drivers/iio/adc/max1027.c
fc167f62483325 Philippe Reynes 2014-06-14 326
fc167f62483325 Philippe Reynes 2014-06-14 327 static int max1027_read_raw(struct iio_dev *indio_dev,
fc167f62483325 Philippe Reynes 2014-06-14 328 struct iio_chan_spec const *chan,
fc167f62483325 Philippe Reynes 2014-06-14 329 int *val, int *val2, long mask)
fc167f62483325 Philippe Reynes 2014-06-14 330 {
fc167f62483325 Philippe Reynes 2014-06-14 331 int ret = 0;
fc167f62483325 Philippe Reynes 2014-06-14 332 struct max1027_state *st = iio_priv(indio_dev);
fc167f62483325 Philippe Reynes 2014-06-14 333
fc167f62483325 Philippe Reynes 2014-06-14 334 mutex_lock(&st->lock);
fc167f62483325 Philippe Reynes 2014-06-14 335
fc167f62483325 Philippe Reynes 2014-06-14 336 switch (mask) {
fc167f62483325 Philippe Reynes 2014-06-14 337 case IIO_CHAN_INFO_RAW:
69515d07652c09 Miquel Raynal 2021-08-18 338 if (iio_buffer_enabled(indio_dev))
69515d07652c09 Miquel Raynal 2021-08-18 339 return -EBUSY;
fc167f62483325 Philippe Reynes 2014-06-14 340 ret = max1027_read_single_value(indio_dev, chan, val);
fc167f62483325 Philippe Reynes 2014-06-14 341 break;
fc167f62483325 Philippe Reynes 2014-06-14 342 case IIO_CHAN_INFO_SCALE:
fc167f62483325 Philippe Reynes 2014-06-14 343 switch (chan->type) {
fc167f62483325 Philippe Reynes 2014-06-14 344 case IIO_TEMP:
fc167f62483325 Philippe Reynes 2014-06-14 345 *val = 1;
fc167f62483325 Philippe Reynes 2014-06-14 346 *val2 = 8;
fc167f62483325 Philippe Reynes 2014-06-14 347 ret = IIO_VAL_FRACTIONAL;
fc167f62483325 Philippe Reynes 2014-06-14 348 break;
fc167f62483325 Philippe Reynes 2014-06-14 349 case IIO_VOLTAGE:
fc167f62483325 Philippe Reynes 2014-06-14 350 *val = 2500;
7af5257d84275c Miquel Raynal 2019-10-11 351 *val2 = chan->scan_type.realbits;
fc167f62483325 Philippe Reynes 2014-06-14 352 ret = IIO_VAL_FRACTIONAL_LOG2;
fc167f62483325 Philippe Reynes 2014-06-14 353 break;
fc167f62483325 Philippe Reynes 2014-06-14 354 default:
fc167f62483325 Philippe Reynes 2014-06-14 355 ret = -EINVAL;
fc167f62483325 Philippe Reynes 2014-06-14 356 break;
fc167f62483325 Philippe Reynes 2014-06-14 357 }
fc167f62483325 Philippe Reynes 2014-06-14 358 break;
fc167f62483325 Philippe Reynes 2014-06-14 359 default:
fc167f62483325 Philippe Reynes 2014-06-14 360 ret = -EINVAL;
fc167f62483325 Philippe Reynes 2014-06-14 361 break;
fc167f62483325 Philippe Reynes 2014-06-14 362 }
fc167f62483325 Philippe Reynes 2014-06-14 363
fc167f62483325 Philippe Reynes 2014-06-14 364 mutex_unlock(&st->lock);
fc167f62483325 Philippe Reynes 2014-06-14 365
fc167f62483325 Philippe Reynes 2014-06-14 @366 return ret;
fc167f62483325 Philippe Reynes 2014-06-14 367 }
fc167f62483325 Philippe Reynes 2014-06-14 368
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38766 bytes --]
next reply other threads:[~2021-08-18 20:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-18 20:58 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-08-18 11:11 [PATCH 00/16] Bring software triggers support to MAX1027-like ADCs Miquel Raynal
2021-08-18 11:11 ` [PATCH 10/16] iio: adc: max1027: Prevent single channel accesses during buffer reads Miquel Raynal
2021-08-20 7:20 ` Sa, Nuno
2021-08-20 7:30 ` Sa, Nuno
2021-08-30 10:20 ` Jonathan Cameron
2021-09-02 8:56 ` Miquel Raynal
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=202108190400.0n3a9cSp-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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.