diff options
| author | Samuel Holland <[email protected]> | 2025-02-20 10:42:30 -0800 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-03-24 17:57:20 +0530 |
| commit | 949c83a799e91cb57903932a84ec63fd14de5dc6 (patch) | |
| tree | 189090d89cf1be9bec3f277c7d50e267d8d4d415 /include | |
| parent | 757f7acafdd25e0ff71a444bbe9f670bc33a3b7f (diff) | |
lib: sbi: Use sbi_hart_count() and sbi_for_each_hartindex()
Simplify the code and improve consistency by using the new macros where
possible. sbi_hart_count() obsoletes sbi_scratch_last_hartindex().
Signed-off-by: Samuel Holland <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_platform.h | 2 | ||||
| -rw-r--r-- | include/sbi/sbi_scratch.h | 3 |
2 files changed, 1 insertions, 4 deletions
diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 5e50c997..3c99d439 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -326,7 +326,7 @@ static inline u32 sbi_platform_tlb_fifo_num_entries(const struct sbi_platform *p { if (plat && sbi_platform_ops(plat)->get_tlb_num_entries) return sbi_platform_ops(plat)->get_tlb_num_entries(); - return sbi_scratch_last_hartindex() + 1; + return sbi_hart_count(); } /** diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h index 293625f1..3cf44c7d 100644 --- a/include/sbi/sbi_scratch.h +++ b/include/sbi/sbi_scratch.h @@ -220,9 +220,6 @@ extern u32 sbi_scratch_hart_count; #define sbi_for_each_hartindex(__var) \ for (u32 __var = 0; __var < sbi_hart_count(); ++__var) -/** Get last HART index having a sbi_scratch pointer */ -#define sbi_scratch_last_hartindex() (sbi_hart_count() - 1) - /** Check whether a particular HART index is valid or not */ #define sbi_hartindex_valid(__hartindex) ((__hartindex) < sbi_hart_count()) |
