Re: [PATCH 1/6] iio: buffer-dma: use lockdep instead of WARN()

Nuno Sá
2025-12-04T11:19:29Z

On Wed, 2025-12-03 at 18:20 +0200, Andy Shevchenko wrote:
> On Wed, Dec 03, 2025 at 03:11:36PM +0000, Nuno Sá via B4 Relay wrote:
> >
> > As documented, WARN() should be used with care given that it can panic
> > running kernels (depending on command line options). So, instead of
> > using it to make sure a lock is held, use the annotations we already
> > have in the kernel for the very same reason.
>
> Which also will be a WARN :-)
>

Obviously :facepalm:

> I believe the main value is a bit different here, i.e. to have code being
> annotated with the existing infrastructure.
>
> In any case I support this change
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>