aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiang W <wxjstz@126.com>2024-05-03 21:53:37 +0800
committerAnup Patel <anup@brainfault.org>2024-05-13 16:40:05 +0530
commit7b37da3cb03e7f75e5834947016aab592498fc9a (patch)
treec45302a2c8ae181c82d07d36f04b7742797b7c64
parente065c3cd5d31314e50f4dca21f181b6a93fe0d45 (diff)
downloadopensbi-7b37da3cb03e7f75e5834947016aab592498fc9a.zip
opensbi-7b37da3cb03e7f75e5834947016aab592498fc9a.tar.gz
opensbi-7b37da3cb03e7f75e5834947016aab592498fc9a.tar.bz2
lib: sbi: fix return type of sbi_dbtr_shmem_disabled
Modify the return value of the sbi_dbtr_shmem_disabled function to bool to make the semantics clearer. Signed-off-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r--lib/sbi/sbi_dbtr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sbi/sbi_dbtr.c b/lib/sbi/sbi_dbtr.c
index a95f087..6950378 100644
--- a/lib/sbi/sbi_dbtr.c
+++ b/lib/sbi/sbi_dbtr.c
@@ -55,18 +55,18 @@ static unsigned long hart_state_ptr_offset;
#error "Undefined XLEN"
#endif
-static inline int sbi_dbtr_shmem_disabled(void)
+static inline bool sbi_dbtr_shmem_disabled(void)
{
struct sbi_dbtr_hart_triggers_state *hs = NULL;
hs = dbtr_get_hart_state_ptr(sbi_scratch_thishart_ptr());
if (!hs)
- return 1;
+ return true;
return (hs->shmem.phys_lo == SBI_DBTR_SHMEM_INVALID_ADDR &&
hs->shmem.phys_hi == SBI_DBTR_SHMEM_INVALID_ADDR
- ? 1 : 0);
+ ? true : false);
}
static inline void sbi_dbtr_disable_shmem(void)