Re: [PATCH 05/11] ASoC: simple-card-utils: Simplify with cleanup.h

From: Kuninori Morimoto
Date: Wed Jul 03 2024 - 22:53:21 EST



Hi Krzysztof

> Allocate the memory with scoped/cleanup.h to reduce error handling (less
> error paths) and make the code a bit simpler.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
> ---
(snip)
> @@ -151,14 +152,15 @@ int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
> if (!dai->tdm_width_map)
> return -ENOMEM;
>
> - array_values = kcalloc(n, sizeof(*array_values), GFP_KERNEL);
> + u32 *array_values __free(kfree) = kcalloc(n, sizeof(*array_values),
> + GFP_KERNEL);

We can use 100 char, it can be 1 line.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>



Thank you for your help !!

Best regards
---
Kuninori Morimoto