Re: [PATCH] iio: adc: qcom-spmi-adc5-gen3: fix lock annotations on mutex helpers

From: Andy Shevchenko

Date: Sun Oct 04 2026 - 04:43:11 EST


On Sun, Oct 04, 2026 at 12:45:16AM +0300, Rupesh Majhi wrote:
> The __acquires() and __releases() on adc5_gen3_mutex_lock() and
> adc5_gen3_mutex_unlock() name adc, a local declared in the body. With
> context analysis enabled for this file, the build fails:
>
> error: use of undeclared identifier 'adc'
>
> The lock and unlock are split across these two helpers for the ADC_TM
> driver, so mark them __context_unsafe() instead.

Doesn't sound right to me. The __acquires() and __releases() IIRC are sparse
annotations. If clang has something special, it needs to be addressed in
the compiler-clang.h, no?

--
With Best Regards,
Andy Shevchenko