]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
firmware: qcom_scm: Cleanup code in qcom_scm_assign_mem()
authorStephen Boyd <swboyd@chromium.org>
Fri, 17 May 2019 21:09:22 +0000 (14:09 -0700)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 22 Jul 2019 23:25:20 +0000 (16:25 -0700)
commitaf311ff9a69189a03548efd5a47d4bb44644fd45
treedbec828a3c446ae0b0420ef78222e223f8111fab
parentc8b08fc0d6f83427973b94694b7ec8855d2d1e37
firmware: qcom_scm: Cleanup code in qcom_scm_assign_mem()

There are some questionable coding styles in this function. It looks
quite odd to deref a pointer with array indexing that only uses the
first element. Also, destroying an input/output variable halfway through
the function and then overwriting it on success is not clear. It's
better to use a local variable and the kernel macros to step through
each bit set in a bitmask and clearly show where outputs are set.

Cc: Ian Jackson <ian.jackson@citrix.com>
Cc: Julien Grall <julien.grall@arm.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
[bjorn: Changed for_each_set_bit() size to BITS_PER_LONG]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/firmware/qcom_scm.c
include/linux/qcom_scm.h