Re: [PATCH 2/6] iio: buffer-dma: Use the cleanup.h API

Jonathan Cameron
2025-12-06T21:12:11Z

On Wed, 3 Dec 2025 18:23:56 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Wed, Dec 03, 2025 at 03:11:37PM +0000, Nuno Sá via B4 Relay wrote:
>
> > Make use of the cleanup.h API for locks and memory allocation in order
> > to simplify some code paths.
>
> ...
>
> > - struct iio_dma_buffer_block *block;
> > -
> > - block = kzalloc(sizeof(*block), GFP_KERNEL);
> > + struct iio_dma_buffer_block *block __free(kfree) = kzalloc(sizeof(*block), GFP_KERNEL);
> > if (!block)
> > return NULL;
>
> In another thread I believe you referred to the 80 rule.
> Follow it then :-)
>
> struct iio_dma_buffer_block *block __free(kfree) =
> kzalloc(sizeof(*block), GFP_KERNEL);

This one is so common I will argue the shorter line form is better.

The other cases you have in some of these patches like the final
one are fine.

Rest of series looks fine to me but open question from Andy
on patch 3 and maybe a trivial patch description change for
that "it WARN() anyway" discussion.

Jonathan

>
>