• Stephen Boyd's avatar
    firmware: qcom_scm: Cleanup code in qcom_scm_assign_mem() · af311ff9
    Stephen Boyd authored
    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: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
    Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
    [bjorn: Changed for_each_set_bit() size to BITS_PER_LONG]
    Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
    af311ff9
qcom_scm.c 15.5 KB