summaryrefslogtreecommitdiff
path: root/core/host
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2021-07-28 16:43:43 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-29 06:16:14 +0000
commitafd9875ab56f4172d3d7fc7ec430ddf9afdc8176 (patch)
treee4ad76c4f1f766f50aba8edbac6fd0292fb7bcf9 /core/host
parent48cbee405bc950a7ec4950213a3d29e918e355e8 (diff)
downloadchrome-ec-afd9875ab56f4172d3d7fc7ec430ddf9afdc8176.tar.gz
atomic.h: atomic_clear_bits: return previously stored value
make the api consistent with other atomic methods BUG=b:192422592 TEST=make BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I6cae4d521b44706cf7f44c669bf6964a08855b4c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3058080 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'core/host')
-rw-r--r--core/host/atomic.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/host/atomic.h b/core/host/atomic.h
index 1513823b6f..83786de904 100644
--- a/core/host/atomic.h
+++ b/core/host/atomic.h
@@ -13,9 +13,9 @@
typedef int atomic_t;
typedef atomic_t atomic_val_t;
-static inline void atomic_clear_bits(atomic_t *addr, atomic_val_t bits)
+static inline atomic_val_t atomic_clear_bits(atomic_t *addr, atomic_val_t bits)
{
- __atomic_fetch_and(addr, ~bits, __ATOMIC_SEQ_CST);
+ return __atomic_fetch_and(addr, ~bits, __ATOMIC_SEQ_CST);
}
static inline atomic_val_t atomic_or(atomic_t *addr, atomic_val_t bits)