diff options
author | 2020-01-07 13:04:13 -0800 | |
---|---|---|
committer | 2020-01-07 22:14:06 -0800 | |
commit | 4a9f1e13b7ed89e66ca9f7c46e48e305402e0732 (patch) | |
tree | 46ee329624dc76fee8989ac78f099625397f5986 /drivers | |
parent | firmware: qcom_scm: Remove unused qcom_scm_get_version (diff) | |
download | linux-4a9f1e13b7ed89e66ca9f7c46e48e305402e0732.tar.gz linux-4a9f1e13b7ed89e66ca9f7c46e48e305402e0732.tar.bz2 linux-4a9f1e13b7ed89e66ca9f7c46e48e305402e0732.zip |
firmware: qcom_scm-64: Make SMC macros less magical
Improve understandability of SMC macros by reversing the logic as they
are all functions of how many arguments can be shoved in registers and
how many SCM arguments are supported.
There aren't 4 register arguments because are 7 arguments that go into a
buffer - there are up to 7 arguments that are overflowed into a buffer
because only 4 registers are allocated for arguments.
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Tested-by: Brian Masney <masneyb@onstation.org> # arm32
Tested-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
Link: https://lore.kernel.org/r/1578431066-19600-5-git-send-email-eberman@codeaurora.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/firmware/qcom_scm-64.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/firmware/qcom_scm-64.c b/drivers/firmware/qcom_scm-64.c index 976c2b9a3cde..3101f3615693 100644 --- a/drivers/firmware/qcom_scm-64.c +++ b/drivers/firmware/qcom_scm-64.c @@ -58,9 +58,9 @@ static DEFINE_MUTEX(qcom_scm_lock); #define QCOM_SCM_EBUSY_WAIT_MS 30 #define QCOM_SCM_EBUSY_MAX_RETRY 20 -#define SCM_SMC_N_EXT_ARGS 7 -#define SCM_SMC_FIRST_EXT_IDX 3 -#define SCM_SMC_N_REG_ARGS (MAX_QCOM_SCM_ARGS - SCM_SMC_N_EXT_ARGS + 1) +#define SCM_SMC_N_REG_ARGS 4 +#define SCM_SMC_FIRST_EXT_IDX (SCM_SMC_N_REG_ARGS - 1) +#define SCM_SMC_N_EXT_ARGS (MAX_QCOM_SCM_ARGS - SCM_SMC_N_REG_ARGS + 1) static void __scm_smc_do_quirk(const struct qcom_scm_desc *desc, struct arm_smccc_res *res, u32 fn_id, |