]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: qcom: q6asm: Fix confusing cleanup.h syntax
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Sat, 29 Nov 2025 13:17:54 +0000 (14:17 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 14 Dec 2025 10:33:13 +0000 (19:33 +0900)
commitc862dc9019f517893eb83096076d7eed4ecbb372
tree5d4f083fc2ba229603b94e1f6a47ceb5f86b9ed3
parentbd9e7182e36169cd7e1ea3b25b5c82b1c5698e64
ASoC: qcom: q6asm: Fix confusing cleanup.h syntax

Commit 6e00112d31c8 ("ASoc: qcom: q6asm: Use automatic cleanup of
kfree()") did not make the code simpler but more complicated.  Already
simple code of allocation and free, without any error paths, got now
declaration with one constructor followed by another allocation, which
is in contrary to explicit coding rules guiding cleanup.h:

"Given that the "__free(...) = NULL" pattern for variables defined at
the top of the function poses this potential interdependency problem the
recommendation is to always define and assign variables in one statement
and not group variable definitions at the top of the function when
__free() is used."

Code does not have a bug, but is less readable and uses discouraged
coding practice, so fix that by moving declaration to the place of
assignment.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20251129-asoc-wrong-cleanup-h-can-people-stop-sending-this-without-reading-docs-v1-2-c38b06884e39@oss.qualcomm.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6asm.c