Re: [PATCH v7 09/10] iio: pressure: dps310: implement .hwfifo_flush_to_buffer()

From: Andy Shevchenko

Date: Fri Sep 25 2026 - 14:18:48 EST


On Fri, Sep 25, 2026 at 08:58:16PM +0300, Rupesh Majhi wrote:
> On Tue, 22 Sep 2026 00:53:47 +0100
> Jonathan Cameron <jic23@xxxxxxxxxx> wrote:
>
> > Adding the guard is fine - we kicked that back a while ago simply
> > due to lack of users. Is there a path to annotating the non
> > ACQUIRE.. functions to expose the right information to clang?
>
> Yes, with the change below. dps310 then builds clean using
> iio_device_try_claim_buffer_mode() and iio_device_release_buffer_mode(),
> and clang warns on a missing or unbalanced release.
>
> 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.

--
With Best Regards,
Andy Shevchenko