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

Andy Shevchenko
2025-12-03T16:24:00Z

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);

--
With Best Regards,
Andy Shevchenko