All the mail mirrored from 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: drivers/iio/magnetometer/af8133j.c:240 af8133j_read_measurement() warn: inconsistent returns '&data->mutex'.
Date: Thu, 11 Apr 2024 03:57:33 +0800	[thread overview]
Message-ID: <202404110355.YGMSPT2j-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Icenowy Zheng <icenowy@aosc.io>
CC: Jonathan Cameron <Jonathan.Cameron@huawei.com>
CC: Dalton Durst <dalton@ubports.com>
CC: Shoji Keita <awaittrot@shjk.jp>
CC: Ondrej Jirman <megi@xff.cz>
CC: Andrey Skvortsov <andrej.skvortzov@gmail.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   2c71fdf02a95b3dd425b42f28fd47fb2b1d22702
commit: 1d8f4b04621f0f33a3d51699ffa32ddf54fe74ed iio: magnetometer: add a driver for Voltafield AF8133J magnetometer
date:   6 weeks ago
:::::: branch date: 27 hours ago
:::::: commit date: 6 weeks ago
config: i386-randconfig-141-20240411 (https://download.01.org/0day-ci/archive/20240411/202404110355.YGMSPT2j-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0

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/202404110355.YGMSPT2j-lkp@intel.com/

smatch warnings:
drivers/iio/magnetometer/af8133j.c:240 af8133j_read_measurement() warn: inconsistent returns '&data->mutex'.

vim +240 drivers/iio/magnetometer/af8133j.c

1d8f4b04621f0f Icenowy Zheng 2024-02-22  209  
1d8f4b04621f0f Icenowy Zheng 2024-02-22  210  static int af8133j_read_measurement(struct af8133j_data *data, __le16 buf[3])
1d8f4b04621f0f Icenowy Zheng 2024-02-22  211  {
1d8f4b04621f0f Icenowy Zheng 2024-02-22  212  	struct device *dev = &data->client->dev;
1d8f4b04621f0f Icenowy Zheng 2024-02-22  213  	int ret;
1d8f4b04621f0f Icenowy Zheng 2024-02-22  214  
1d8f4b04621f0f Icenowy Zheng 2024-02-22  215  	ret = pm_runtime_resume_and_get(dev);
1d8f4b04621f0f Icenowy Zheng 2024-02-22  216  	if (ret) {
1d8f4b04621f0f Icenowy Zheng 2024-02-22  217  		/*
1d8f4b04621f0f Icenowy Zheng 2024-02-22  218  		 * Ignore EACCES because that happens when RPM is disabled
1d8f4b04621f0f Icenowy Zheng 2024-02-22  219  		 * during system sleep, while userspace leave eg. hrtimer
1d8f4b04621f0f Icenowy Zheng 2024-02-22  220  		 * trigger attached and IIO core keeps trying to do measurements.
1d8f4b04621f0f Icenowy Zheng 2024-02-22  221  		 */
1d8f4b04621f0f Icenowy Zheng 2024-02-22  222  		if (ret != -EACCES)
1d8f4b04621f0f Icenowy Zheng 2024-02-22  223  			dev_err(dev, "Failed to power on (%d)\n", ret);
1d8f4b04621f0f Icenowy Zheng 2024-02-22  224  		return ret;
1d8f4b04621f0f Icenowy Zheng 2024-02-22  225  	}
1d8f4b04621f0f Icenowy Zheng 2024-02-22  226  
1d8f4b04621f0f Icenowy Zheng 2024-02-22  227  	scoped_guard(mutex, &data->mutex) {
1d8f4b04621f0f Icenowy Zheng 2024-02-22  228  		ret = af8133j_take_measurement(data);
1d8f4b04621f0f Icenowy Zheng 2024-02-22  229  		if (ret)
1d8f4b04621f0f Icenowy Zheng 2024-02-22  230  			goto out_rpm_put;
1d8f4b04621f0f Icenowy Zheng 2024-02-22  231  
1d8f4b04621f0f Icenowy Zheng 2024-02-22  232  		ret = regmap_bulk_read(data->regmap, AF8133J_REG_OUT,
1d8f4b04621f0f Icenowy Zheng 2024-02-22  233  				       buf, sizeof(__le16) * 3);
1d8f4b04621f0f Icenowy Zheng 2024-02-22  234  	}
1d8f4b04621f0f Icenowy Zheng 2024-02-22  235  
1d8f4b04621f0f Icenowy Zheng 2024-02-22  236  out_rpm_put:
1d8f4b04621f0f Icenowy Zheng 2024-02-22  237  	pm_runtime_mark_last_busy(dev);
1d8f4b04621f0f Icenowy Zheng 2024-02-22  238  	pm_runtime_put_autosuspend(dev);
1d8f4b04621f0f Icenowy Zheng 2024-02-22  239  
1d8f4b04621f0f Icenowy Zheng 2024-02-22 @240  	return ret;
1d8f4b04621f0f Icenowy Zheng 2024-02-22  241  }
1d8f4b04621f0f Icenowy Zheng 2024-02-22  242  

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

                 reply	other threads:[~2024-04-10 19:58 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=202404110355.YGMSPT2j-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.