Re: [PATCH] soundwire: qcom: Use guard to avoid mixing cleanup and goto

From: Konrad Dybcio
Date: Mon Dec 01 2025 - 05:59:52 EST


On 12/1/25 11:26 AM, Krzysztof Kozlowski wrote:
> qcom_swrm_stream_alloc_ports() already uses cleanup.h but also has goto.
> Such combination is error-prone and discouraged:
>
> "... and that the "goto" statement can jump between scopes, the
> expectation is that usage of "goto" and cleanup helpers is never mixed
> in the same function."
>
> Actually simplify the code with a guard which allows to fix the
> discouraged style by removing the goto.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad