summaryrefslogtreecommitdiff
path: root/core/host
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2020-10-28 10:02:32 +0100
committerCommit Bot <commit-bot@chromium.org>2020-11-02 10:17:27 +0000
commit71069893536962157b3b25330851a1c2c7cd6da5 (patch)
tree22c6f60ff900b68871f81e44cfe01b7616561bb6 /core/host
parent0438542f2690e958d47dd28636797acbd29fcd9d (diff)
downloadchrome-ec-71069893536962157b3b25330851a1c2c7cd6da5.tar.gz
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 <dn@semihalf.com> Change-Id: I2588971bd7687879a28ec637cf5f6c3d27d393f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2505143 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'core/host')
-rw-r--r--core/host/atomic.h2
-rw-r--r--core/host/task.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/host/atomic.h b/core/host/atomic.h
index aaf990dac1..1513823b6f 100644
--- a/core/host/atomic.h
+++ b/core/host/atomic.h
@@ -33,7 +33,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/host/task.c b/core/host/task.c
index e73f8c57fe..6b3ff31a81 100644
--- a/core/host/task.c
+++ b/core/host/task.c
@@ -224,7 +224,7 @@ uint32_t task_wait_event(int timeout_us)
pthread_cond_wait(&tasks[tid].resume, &run_lock);
/* Resume */
- ret = atomic_read_clear(&tasks[tid].event);
+ ret = atomic_clear(&tasks[tid].event);
pthread_mutex_unlock(&interrupt_lock);
return ret;
}