]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
soundwire: qcom: Use guard to avoid mixing cleanup and goto
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Mon, 1 Dec 2025 10:26:28 +0000 (11:26 +0100)
committerVinod Koul <vkoul@kernel.org>
Tue, 16 Dec 2025 09:10:00 +0000 (14:40 +0530)
commit82ab754d102273f4c974a285aa8025bed7521b15
tree9cbba4d84239e805cfd684f9bfec8e660e4050c8
parentf87e5575a6bd1925cd55f500b61b661724372e5f
soundwire: qcom: Use guard to avoid mixing cleanup and goto

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@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251201102627.146182-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/qcom.c