scsi: ufs: qcom: Fix confusing cleanup.h syntax
authorKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Mon, 8 Dec 2025 02:08:08 +0000 (03:08 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Dec 2025 03:11:00 +0000 (22:11 -0500)
commit946574434aa9cfe175c3e8234734a3822410ff53
tree3b71e45366b27c3704eaaa2a93e7b56592f28426
parent362432e9b9aefb914ab7d9f86c9fc384a6620c41
scsi: ufs: qcom: Fix confusing cleanup.h syntax

Initializing automatic __free variables to NULL without need (e.g.
branches with different allocations), followed by actual allocation 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: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20251208020807.5043-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/ufs/host/ufs-qcom.c