Re: [PATCH v2 1/3] [PATCH 1/3] gpio: acpi: modernize resource management using cleanup.h

From: Andy Shevchenko

Date: Wed May 06 2026 - 08:55:13 EST


On Wed, May 06, 2026 at 02:35:34PM +0200, Marco Scardovi wrote:

No, this is wrong and completely missed the guidelines!
Please, spend near hours to study the Submitting Patches and Coding Style
kernel documentation before preparing and sending a v3.

...

> +#include <linux/cleanup.h>
> +#include <linux/slab.h>
> #include <linux/acpi.h>
> #include <linux/dmi.h>
> #include <linux/errno.h>

...

> +DEFINE_FREE(free_gpio_desc, struct gpio_desc *, {
> + if (_T)
> + gpiochip_free_own_desc(_T);
> +})
> +
> +DEFINE_FREE(acpi_free, void *, {
> + if (_T)
> + ACPI_FREE(_T);
> +})

And yes, these are still subject to comments I gave against v1.

--
With Best Regards,
Andy Shevchenko