summaryrefslogtreecommitdiff
path: root/core/cortex-m0/task.c
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2021-11-03 22:40:26 +0000
committerCommit Bot <commit-bot@chromium.org>2021-11-09 20:01:00 +0000
commit107bea02fefdc4286e929d5cde48b2a57a0ded21 (patch)
tree2425f5da2266263843be341dda7ef1d3bf80699d /core/cortex-m0/task.c
parentbb8a41cb2ba8b5c66a4035772173eb0057a9096c (diff)
downloadchrome-ec-107bea02fefdc4286e929d5cde48b2a57a0ded21.tar.gz
task: Use bool for truthy return types
Using bool makes it clear that the function returns "true" or "false", rather than any integer. It also avoids the need to use "!!" to set the value to 0 or 1, since the compiler ensures that "bool" is always a 0 or 1, even if another value is assigned. BRANCH=none BUG=b:172020503 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I164e5c03c23fa2f0ffb61e87f5613e080814ce10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262593 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'core/cortex-m0/task.c')
-rw-r--r--core/cortex-m0/task.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index 2c1bf2a8c4..af1886005b 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -161,7 +161,7 @@ void interrupt_enable(void)
asm("cpsie i");
}
-inline int is_interrupt_enabled(void)
+inline bool is_interrupt_enabled(void)
{
int primask;
@@ -171,7 +171,7 @@ inline int is_interrupt_enabled(void)
return !(primask & 0x1);
}
-inline int in_interrupt_context(void)
+inline bool in_interrupt_context(void)
{
int ret;
asm("mrs %0, ipsr\n" /* read exception number */