From: Andrew Jones Date: Mon, 27 Feb 2023 10:30:59 +0000 (+0100) Subject: lib: sbi_hsm: Move misplaced comment X-Git-Tag: accepted/tizen/unified/riscv/20231123.095152~50 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1ae6ef33ba92fe7d85edd87656998330637ed7e;p=platform%2Fkernel%2Fopensbi.git lib: sbi_hsm: Move misplaced comment While non-retentive suspend is not allowed for M-mode, the comment at the top of sbi_hsm_hart_suspend() implied suspend wasn't allowed for M-mode at all. Move the comment above the mode check which is inside a suspend type is non-retentive check. Signed-off-by: Andrew Jones Reviewed-by: Anup Patel --- diff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c index 3455520..294156a 100644 --- a/lib/sbi/sbi_hsm.c +++ b/lib/sbi/sbi_hsm.c @@ -398,8 +398,6 @@ int sbi_hsm_hart_suspend(struct sbi_scratch *scratch, u32 suspend_type, struct sbi_hsm_data *hdata = sbi_scratch_offset_ptr(scratch, hart_data_offset); - /* For now, we only allow suspend from S-mode or U-mode. */ - /* Sanity check on domain assigned to current HART */ if (!dom) return SBI_EFAIL; @@ -414,6 +412,10 @@ int sbi_hsm_hart_suspend(struct sbi_scratch *scratch, u32 suspend_type, /* Additional sanity check for non-retentive suspend */ if (suspend_type & SBI_HSM_SUSP_NON_RET_BIT) { + /* + * For now, we only allow non-retentive suspend from + * S-mode or U-mode. + */ if (rmode != PRV_S && rmode != PRV_U) return SBI_EFAIL; if (dom && !sbi_domain_check_addr(dom, raddr, rmode,