aboutsummaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_hsm.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-03-14 14:20:22 +0530
committerAnup Patel <anup@brainfault.org>2020-03-19 09:04:29 +0530
commite23d3ba936698c52c83bbeed8d844fea22ae0859 (patch)
tree8f0709f322cf42f04f5eab85f20bb240133aa519 /lib/sbi/sbi_hsm.c
parent87a7ef7659e27cdd5ef9a639cd68cf628be3d2d3 (diff)
include: Simplify HART id to scratch macro
This patch simplify HART id to scratch macro as follows: 1. Remove current "scratch" pointer argument because now we use HART id to scratch table 2. Rename sbi_hart_id_to_scratch() to sbi_hartid_to_scratch() to have macro name consistent with the name of callback in struct sbi_scratch Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/sbi/sbi_hsm.c')
-rw-r--r--lib/sbi/sbi_hsm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c
index bd58782..e8ca428 100644
--- a/lib/sbi/sbi_hsm.c
+++ b/lib/sbi/sbi_hsm.c
@@ -59,7 +59,7 @@ int sbi_hsm_hart_get_state(struct sbi_scratch *scratch, u32 hartid)
{
struct sbi_hsm_data *hdata;
- scratch = sbi_hart_id_to_scratch(scratch, hartid);
+ scratch = sbi_hartid_to_scratch(hartid);
hdata = sbi_scratch_offset_ptr(scratch, hart_data_offset);
return atomic_read(&hdata->state);
@@ -163,7 +163,7 @@ int sbi_hsm_init(struct sbi_scratch *scratch, u32 hartid, bool cold_boot)
/* Initialize hart state data for every hart */
for (i = 0; i < hart_count; i++) {
- rscratch = sbi_hart_id_to_scratch(scratch, i);
+ rscratch = sbi_hartid_to_scratch(i);
hdata = sbi_scratch_offset_ptr(rscratch,
hart_data_offset);
ATOMIC_INIT(&hdata->state,
@@ -215,7 +215,7 @@ int sbi_hsm_hart_start(struct sbi_scratch *scratch, u32 hartid,
unsigned int hstate;
int rc;
const struct sbi_platform *plat = sbi_platform_ptr(scratch);
- struct sbi_scratch *rscratch = sbi_hart_id_to_scratch(scratch, hartid);
+ struct sbi_scratch *rscratch = sbi_hartid_to_scratch(hartid);
struct sbi_hsm_data *hdata = sbi_scratch_offset_ptr(rscratch,
hart_data_offset);