From: Rupesh Majhi <zoone.rupert@gmail.com>
To: "Alex Lanzano" <lanzano.alex@gmail.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Benson Leung" <bleung@chromium.org>,
"David Lechner" <dlechner@baylibre.com>,
"Guenter Roeck" <groeck@chromium.org>,
"Jagath Jog J" <jagathjog1996@gmail.com>,
"Javier Carrasco" <javier.carrasco.cruz@gmail.com>,
"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Jinseob Kim" <kimjinseob88@gmail.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"Kevin Hilman" <khilman@baylibre.com>,
"Lorenzo Bianconi" <lorenzo@kernel.org>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Matti Vaittinen" <mazziesaccount@gmail.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Nuno Sá" <nuno.sa@analog.com>,
"Remi Buisson" <remi.buisson@tdk.com>
Cc: chrome-platform@lists.linux.dev,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org,
Rupesh Majhi <zoone.rupert@gmail.com>,
Bart Van Assche <bvanassche@acm.org>,
Marco Elver <elver@google.com>,
Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
Subject: [PATCH v4 1/9] iio: adc: qcom-spmi-adc5-gen3: fix lock annotations on mutex helpers
Date: Tue, 27 Oct 2026 14:49:46 +0200 [thread overview]
Message-ID: <20261027124954.110697-2-zoone.rupert@gmail.com> (raw)
In-Reply-To: <20261027124954.110697-1-zoone.rupert@gmail.com>
Since commit 5b63d0ae94cc ("compiler-context-analysis: Remove Sparse
support"), __acquires() and __releases() only feed context analysis.
Their argument is parsed before the function body, where only dev is in
scope, so with analysis enabled for this file the build fails:
error: use of undeclared identifier 'adc'
Name the lock through dev, the same way the bodies find it. The analysis
then also checks that the helpers really take and drop it.
Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Rupesh Majhi <zoone.rupert@gmail.com>
---
Cc: Marco Elver <elver@google.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
v4: name the lock through dev instead of __context_unsafe() (Bart),
now the first patch of the series that enables the analysis (Jonathan)
v3: drop Fixes tag (Jonathan), trailer cleanup (Andy)
https://lore.kernel.org/linux-iio/20261025191510.22261-1-zoone.rupert@gmail.com/
v2: __context_unsafe() explained in commit message (Andy)
https://lore.kernel.org/linux-iio/20261021052435.112686-1-zoone.rupert@gmail.com/
v1: https://lore.kernel.org/linux-iio/20261003214516.128573-1-zoone.rupert@gmail.com/
drivers/iio/adc/qcom-spmi-adc5-gen3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/qcom-spmi-adc5-gen3.c b/drivers/iio/adc/qcom-spmi-adc5-gen3.c
index c68c6c5f6aca..09013c6e44a0 100644
--- a/drivers/iio/adc/qcom-spmi-adc5-gen3.c
+++ b/drivers/iio/adc/qcom-spmi-adc5-gen3.c
@@ -663,7 +663,7 @@ static int adc5_gen3_add_aux_tm_device(struct adc5_chip *adc)
}
void adc5_gen3_mutex_lock(struct device *dev)
- __acquires(&adc->lock)
+ __acquires(&((struct adc5_chip *)iio_priv(dev_get_drvdata(dev->parent)))->lock)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev->parent);
struct adc5_chip *adc = iio_priv(indio_dev);
@@ -673,7 +673,7 @@ void adc5_gen3_mutex_lock(struct device *dev)
EXPORT_SYMBOL_NS_GPL(adc5_gen3_mutex_lock, "QCOM_SPMI_ADC5_GEN3");
void adc5_gen3_mutex_unlock(struct device *dev)
- __releases(&adc->lock)
+ __releases(&((struct adc5_chip *)iio_priv(dev_get_drvdata(dev->parent)))->lock)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev->parent);
struct adc5_chip *adc = iio_priv(indio_dev);
--
2.43.0
next prev parent reply other threads:[~2026-10-27 12:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 12:49 [PATCH v4 0/9] iio: enable context analysis for all drivers Rupesh Majhi
2026-10-27 12:49 ` Rupesh Majhi [this message]
2026-10-27 12:49 ` [PATCH v4 2/9] iio: core: annotate the conditional mode claims Rupesh Majhi
2026-10-27 12:49 ` [PATCH v4 3/9] iio: core: mark the mode lock helpers __context_unsafe Rupesh Majhi
2026-10-27 12:49 ` [PATCH v4 4/9] iio: accel: kionix-kx022a: annotate the lock helpers Rupesh Majhi
2026-10-27 12:49 ` [PATCH v4 5/9] iio: adc: meson_saradc: " Rupesh Majhi
2026-10-27 12:49 ` [PATCH v4 6/9] iio: buffer-dma: annotate the queue " Rupesh Majhi
2026-10-27 12:49 ` [PATCH v4 7/9] iio: light: opt3001: mark the interrupt handler __context_unsafe Rupesh Majhi
2026-10-27 12:49 ` [PATCH v4 8/9] iio: light: veml6031x00: annotate the event enable helpers Rupesh Majhi
2026-10-27 16:52 ` Javier Carrasco
2026-10-27 12:49 ` [PATCH v4 9/9] iio: enable context analysis for all drivers Rupesh Majhi
2026-10-27 15:09 ` Kim Jinseob
2026-10-27 16:14 ` Andy Shevchenko
2026-10-27 17:21 ` Marco Elver
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=20261027124954.110697-2-zoone.rupert@gmail.com \
--to=zoone.rupert@gmail.com \
--cc=andy@kernel.org \
--cc=bleung@chromium.org \
--cc=bvanassche@acm.org \
--cc=chrome-platform@lists.linux.dev \
--cc=dlechner@baylibre.com \
--cc=elver@google.com \
--cc=groeck@chromium.org \
--cc=jagathjog1996@gmail.com \
--cc=javier.carrasco.cruz@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=jean-baptiste.maneyrol@tdk.com \
--cc=jic23@kernel.org \
--cc=jishnu.prakash@oss.qualcomm.com \
--cc=khilman@baylibre.com \
--cc=kimjinseob88@gmail.com \
--cc=lanzano.alex@gmail.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=mazziesaccount@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=nuno.sa@analog.com \
--cc=remi.buisson@tdk.com \
/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®