[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFR4EZFDOSJS.2U76CKFU7TVT2@gmail.com>
Date: Sat, 17 Jan 2026 14:45:04 -0500
From: "Kurt Borja" <kuurtb@...il.com>
To: "Andy Shevchenko" <andy.shevchenko@...il.com>, "David Lechner"
<dlechner@...libre.com>
Cc: "Kurt Borja" <kuurtb@...il.com>, "Andy Shevchenko"
<andriy.shevchenko@...el.com>, "Lars-Peter Clausen" <lars@...afoo.de>,
"Michael Hennerich" <Michael.Hennerich@...log.com>, "Jonathan Cameron"
<jic23@...nel.org>, "Benson Leung" <bleung@...omium.org>, "Antoniu Miclaus"
<antoniu.miclaus@...log.com>, "Gwendal Grignou" <gwendal@...omium.org>,
"Shrikant Raskar" <raskar.shree97@...il.com>, "Per-Daniel Olsson"
<perdaniel.olsson@...s.com>, Nuno Sá <nuno.sa@...log.com>,
"Andy Shevchenko" <andy@...nel.org>, "Guenter Roeck" <groeck@...omium.org>,
"Jonathan Cameron" <Jonathan.Cameron@...wei.com>,
"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"chrome-platform@...ts.linux.dev" <chrome-platform@...ts.linux.dev>
Subject: Re: [PATCH v3 2/7] iio: core: Refactor iio_device_claim_direct()
implementation
On Sat Jan 17, 2026 at 7:01 AM -05, Andy Shevchenko wrote:
> пʼятниця, 16 січня 2026 р. David Lechner <dlechner@...libre.com> пише:
>
>> On 1/6/26 2:06 AM, Kurt Borja wrote:
>> > In order to eventually unify the locking API, implement
>> > iio_device_claim_direct() fully inline, with the use of
>> > __iio_dev_mode_lock(), which takes care of sparse annotations.
>> >
>> > Signed-off-by: Kurt Borja <kuurtb@...il.com>
>> > ---
>>
>> ...
>>
>> > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
>> > index aecda887d833..3cf340208694 100644
>> > --- a/include/linux/iio/iio.h
>> > +++ b/include/linux/iio/iio.h
>> > @@ -664,31 +664,47 @@ int iio_push_event(struct iio_dev *indio_dev, u64
>> ev_code, s64 timestamp);
>> >
>> > void __iio_dev_mode_lock(struct iio_dev *indio_dev)
>> __acquires(indio_dev);
>> > void __iio_dev_mode_unlock(struct iio_dev *indio_dev)
>> __releases(indio_dev);
>> > -bool __iio_device_claim_direct(struct iio_dev *indio_dev);
>> > -void __iio_device_release_direct(struct iio_dev *indio_dev);
>> >
>> > /*
>> > * Helper functions that allow claim and release of direct mode
>> > * in a fashion that doesn't generate many false positives from sparse.
>> > * Note this must remain static inline in the header so that sparse
>> > - * can see the __acquire() marking. Revisit when sparse supports
>> > - * __cond_acquires()
>> > + * can see the __acquires() and __releases() markings.
>> > + */
>> > +
>> nit: I think "attributes" would be more technically correct than
>> "markings" (since we are touching this).
>>
>
> The annotations is slightly better because these are for sparse and not for
> compiler.
Hi Andy,
Yes, annotations also matches the Sparse documentation so I'll go with
that.
--
Thanks,
~ Kurt
Powered by blists - more mailing lists