Re: [PATCH v7 09/10] iio: pressure: dps310: implement .hwfifo_flush_to_buffer()
From: Rupesh Majhi
Date: Fri Sep 25 2026 - 14:36:34 EST
On Fri, Sep 25, 2026 at 09:18:31PM +0300, Andy Shevchenko wrote:
> On Fri, Sep 25, 2026 at 08:58:16PM +0300, Rupesh Majhi wrote:
> > context_lock_struct() is needed because clang rejects the existing
> > __acquires(indio_dev) on a type that is not a lock. The header
> > suppression list hides that today.
>
> But why you can't supply the full lock to the __acquires()? If
> to_iio_dev_opaque() is a macro it should all work.
to_iio_dev_opaque() needs iio-opaque.h, which drivers do not include,
and pulling it into iio.h makes clang 23 crash on the container_of().
An accessor works though:
struct mutex *__iio_dev_mode_mutex(struct iio_dev *indio_dev);
void __iio_dev_mode_lock(struct iio_dev *indio_dev)
__acquires(__iio_dev_mode_mutex(indio_dev));
With the core helpers locking through it too, clang checks them as
well, so context_lock_struct() and __no_context_analysis both go away.
I will use that in v9.
Rupesh