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 /include/task.h | |
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 'include/task.h')
-rw-r--r-- | include/task.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/task.h b/include/task.h index 94b7a39908..fdfae9d5c6 100644 --- a/include/task.h +++ b/include/task.h @@ -83,7 +83,7 @@ void interrupt_enable(void); /** * Check if interrupts are enabled */ -int is_interrupt_enabled(void); +bool is_interrupt_enabled(void); /* * Define irq_lock and irq_unlock that match the function signatures to Zephyr's @@ -119,12 +119,12 @@ void irq_unlock(uint32_t key); /** * Return true if we are in interrupt context. */ -int in_interrupt_context(void); +bool in_interrupt_context(void); /** * Return true if we are in software interrupt context. */ -int in_soft_interrupt_context(void); +bool in_soft_interrupt_context(void); /** * Return current interrupt mask with disabling interrupt. Meaning is |