]> git.baikalelectronics.ru Git - 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)
commit78fcd5b6e12b9b1ad9e2a4d7c615f96ee7e38fc4
treedbec828a3c446ae0b0420ef78222e223f8111fab
parent4f96c61a3c6f7d84f62b240ca44cf6575b98aff8
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