diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-11-03 22:40:26 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-11-09 20:01:00 +0000 |
commit | 107bea02fefdc4286e929d5cde48b2a57a0ded21 (patch) | |
tree | 2425f5da2266263843be341dda7ef1d3bf80699d /core/cortex-m | |
parent | bb8a41cb2ba8b5c66a4035772173eb0057a9096c (diff) | |
download | chrome-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-m')
-rw-r--r-- | core/cortex-m/task.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index b86750bd67..fa5642cca6 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -227,7 +227,7 @@ void interrupt_enable(void) asm("cpsie i"); } -inline int is_interrupt_enabled(void) +inline bool is_interrupt_enabled(void) { int primask; @@ -237,7 +237,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 */ |