diff options
author | Bin Meng <bmeng@tinylab.org> | 2022-12-21 14:38:06 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-01-06 14:56:35 +0300 |
commit | 440fa818fbffd0771d75890c4fcda062ceab7ebd (patch) | |
tree | ddc51462269d7532149eab1bd60000158c37a535 /include/sbi | |
parent | 6b5188ca14e59ce7bf71afe4e7d3d557c3d31bf8 (diff) | |
download | opensbi-440fa818fbffd0771d75890c4fcda062ceab7ebd.tar.xz |
treewide: Replace TRUE/FALSE with true/false
C language standard uses true/false for the boolean type.
Let's switch to that for better language compatibility.
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Samuel Holland <samuel@sholland.org>
Tested-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'include/sbi')
-rw-r--r-- | include/sbi/sbi_domain.h | 4 | ||||
-rw-r--r-- | include/sbi/sbi_list.h | 2 | ||||
-rw-r--r-- | include/sbi/sbi_platform.h | 18 | ||||
-rw-r--r-- | include/sbi/sbi_types.h | 6 |
4 files changed, 14 insertions, 16 deletions
diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index 5553d21..f0d9289 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -113,7 +113,7 @@ extern struct sbi_domain *domidx_to_domain_table[]; * Check whether given HART is assigned to specified domain * @param dom pointer to domain * @param hartid the HART ID - * @return TRUE if HART is assigned to domain otherwise FALSE + * @return true if HART is assigned to domain otherwise false */ bool sbi_domain_is_assigned_hart(const struct sbi_domain *dom, u32 hartid); @@ -148,7 +148,7 @@ void sbi_domain_memregion_init(unsigned long addr, * @param addr the address to be checked * @param mode the privilege mode of access * @param access_flags bitmask of domain access types (enum sbi_domain_access) - * @return TRUE if access allowed otherwise FALSE + * @return true if access allowed otherwise false */ bool sbi_domain_check_addr(const struct sbi_domain *dom, unsigned long addr, unsigned long mode, diff --git a/include/sbi/sbi_list.h b/include/sbi/sbi_list.h index b1178df..fe735df 100644 --- a/include/sbi/sbi_list.h +++ b/include/sbi/sbi_list.h @@ -47,7 +47,7 @@ static inline void __sbi_list_add(struct sbi_dlist *new, * Checks if the list is empty or not. * @param head List head * - * Retruns TRUE if list is empty, FALSE otherwise. + * Returns true if list is empty, false otherwise. */ static inline bool sbi_list_empty(struct sbi_dlist *head) { diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h index 722f27a..010e9ce 100644 --- a/include/sbi/sbi_platform.h +++ b/include/sbi/sbi_platform.h @@ -344,16 +344,16 @@ static inline u32 sbi_platform_hart_stack_size(const struct sbi_platform *plat) * @param plat pointer to struct sbi_platform * @param hartid HART ID * - * @return TRUE if HART is invalid and FALSE otherwise + * @return true if HART is invalid and false otherwise */ static inline bool sbi_platform_hart_invalid(const struct sbi_platform *plat, u32 hartid) { if (!plat) - return TRUE; + return true; if (plat->hart_count <= sbi_platform_hart_index(plat, hartid)) - return TRUE; - return FALSE; + return true; + return false; } /** @@ -377,7 +377,7 @@ static inline int sbi_platform_nascent_init(const struct sbi_platform *plat) * Early initialization for current HART * * @param plat pointer to struct sbi_platform - * @param cold_boot whether cold boot (TRUE) or warm_boot (FALSE) + * @param cold_boot whether cold boot (true) or warm_boot (false) * * @return 0 on success and negative error code on failure */ @@ -393,7 +393,7 @@ static inline int sbi_platform_early_init(const struct sbi_platform *plat, * Final initialization for current HART * * @param plat pointer to struct sbi_platform - * @param cold_boot whether cold boot (TRUE) or warm_boot (FALSE) + * @param cold_boot whether cold boot (true) or warm_boot (false) * * @return 0 on success and negative error code on failure */ @@ -538,7 +538,7 @@ static inline int sbi_platform_console_init(const struct sbi_platform *plat) * Initialize the platform interrupt controller for current HART * * @param plat pointer to struct sbi_platform - * @param cold_boot whether cold boot (TRUE) or warm_boot (FALSE) + * @param cold_boot whether cold boot (true) or warm_boot (false) * * @return 0 on success and negative error code on failure */ @@ -565,7 +565,7 @@ static inline void sbi_platform_irqchip_exit(const struct sbi_platform *plat) * Initialize the platform IPI support for current HART * * @param plat pointer to struct sbi_platform - * @param cold_boot whether cold boot (TRUE) or warm_boot (FALSE) + * @param cold_boot whether cold boot (true) or warm_boot (false) * * @return 0 on success and negative error code on failure */ @@ -592,7 +592,7 @@ static inline void sbi_platform_ipi_exit(const struct sbi_platform *plat) * Initialize the platform timer for current HART * * @param plat pointer to struct sbi_platform - * @param cold_boot whether cold boot (TRUE) or warm_boot (FALSE) + * @param cold_boot whether cold boot (true) or warm_boot (false) * * @return 0 on success and negative error code on failure */ diff --git a/include/sbi/sbi_types.h b/include/sbi/sbi_types.h index 7fb1af7..75cdddd 100644 --- a/include/sbi/sbi_types.h +++ b/include/sbi/sbi_types.h @@ -54,10 +54,8 @@ typedef unsigned long virtual_size_t; typedef unsigned long physical_addr_t; typedef unsigned long physical_size_t; -#define TRUE 1 -#define FALSE 0 -#define true TRUE -#define false FALSE +#define true 1 +#define false 0 #define NULL ((void *)0) |