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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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




[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux