aboutsummaryrefslogtreecommitdiff
path: root/lib/sbi/sbi_hsm.c
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-03-14 19:26:22 +0530
committerAnup Patel <anup@brainfault.org>2020-03-19 09:26:25 +0530
commit814f38dc1d9ec6cd7f75b0d6be15e861ddac9ac5 (patch)
tree001af4c2a9ee6b373defe2deb20d2ca00a2e6091 /lib/sbi/sbi_hsm.c
parentdb187d616c6bfd9f01bbc566117bf5a6241660c1 (diff)
lib: sbi_hsm: Don't use sbi_platform_hart_disabled() API
Checking return value of sbi_hartid_to_scratch() is sufficient so no need to explicitly check for disabled HART using the sbi_platform_hart_disabled() API. 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, 1 insertions, 5 deletions
diff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c
index 4a457ce..10316c5 100644
--- a/lib/sbi/sbi_hsm.c
+++ b/lib/sbi/sbi_hsm.c
@@ -216,8 +216,6 @@ int sbi_hsm_hart_start(struct sbi_scratch *scratch, u32 hartid,
if (!rscratch)
return SBI_EINVAL;
hdata = sbi_scratch_offset_ptr(rscratch, hart_data_offset);
- if (sbi_platform_hart_disabled(plat, hartid))
- return SBI_EINVAL;
hstate = arch_atomic_cmpxchg(&hdata->state, SBI_HART_STOPPED,
SBI_HART_STARTING);
if (hstate == SBI_HART_STARTED)
@@ -254,12 +252,10 @@ int sbi_hsm_hart_stop(struct sbi_scratch *scratch, bool exitnow)
{
int oldstate;
u32 hartid = current_hartid();
- const struct sbi_platform *plat = sbi_platform_ptr(scratch);
struct sbi_hsm_data *hdata = sbi_scratch_offset_ptr(scratch,
hart_data_offset);
- if (sbi_platform_hart_disabled(plat, hartid) ||
- !sbi_hsm_hart_started(hartid))
+ if (!sbi_hsm_hart_started(hartid))
return SBI_EINVAL;
oldstate = arch_atomic_cmpxchg(&hdata->state, SBI_HART_STARTED,