From 71069893536962157b3b25330851a1c2c7cd6da5 Mon Sep 17 00:00:00 2001 From: Dawid Niedzwiecki Date: Wed, 28 Oct 2020 10:02:32 +0100 Subject: atomic: rename atomic_read_clear to atomic_clear Rename atomic_read_clear to atomic_clear to be consistent with the rest of the atomic functions, which return the previous value of the variable. BUG=b:169151160 BRANCH=none TEST=buildall Signed-off-by: Dawid Niedzwiecki Change-Id: I2588971bd7687879a28ec637cf5f6c3d27d393f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2505143 Reviewed-by: Tom Hughes Reviewed-by: Jett Rink Reviewed-by: Jack Rosenthal --- core/minute-ia/atomic.h | 2 +- core/minute-ia/task.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'core/minute-ia') diff --git a/core/minute-ia/atomic.h b/core/minute-ia/atomic.h index 7c63268963..225bf0329d 100644 --- a/core/minute-ia/atomic.h +++ b/core/minute-ia/atomic.h @@ -62,7 +62,7 @@ static inline atomic_val_t atomic_sub(atomic_t *addr, atomic_val_t value) return __atomic_fetch_sub(addr, value, __ATOMIC_SEQ_CST); } -static inline atomic_val_t atomic_read_clear(atomic_t *addr) +static inline atomic_val_t atomic_clear(atomic_t *addr) { return __atomic_exchange_n(addr, 0, __ATOMIC_SEQ_CST); } diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c index 8a54772ada..6d5be5f92d 100644 --- a/core/minute-ia/task.c +++ b/core/minute-ia/task.c @@ -318,7 +318,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched) ret = timer_arm(deadline, me); ASSERT(ret == EC_SUCCESS); } - while (!(evt = atomic_read_clear(&tsk->events))) { + while (!(evt = atomic_clear(&tsk->events))) { /* Remove ourself and get the next task in the scheduler */ __schedule(1, resched); resched = TASK_ID_IDLE; -- cgit v1.2.1