diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2020-10-28 10:02:32 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-02 10:17:27 +0000 |
commit | 71069893536962157b3b25330851a1c2c7cd6da5 (patch) | |
tree | 22c6f60ff900b68871f81e44cfe01b7616561bb6 /common/fpsensor | |
parent | 0438542f2690e958d47dd28636797acbd29fcd9d (diff) | |
download | chrome-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 'common/fpsensor')
-rw-r--r-- | common/fpsensor/fpsensor.c | 6 | ||||
-rw-r--r-- | common/fpsensor/fpsensor_state.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/common/fpsensor/fpsensor.c b/common/fpsensor/fpsensor.c index 2e88319b5d..6b782845f2 100644 --- a/common/fpsensor/fpsensor.c +++ b/common/fpsensor/fpsensor.c @@ -787,7 +787,7 @@ int command_fpenroll(int argc, char **argv) FP_MODE_ENROLL_IMAGE); if (rc != EC_SUCCESS) break; - event = atomic_read_clear(&fp_events); + event = atomic_clear(&fp_events); percent = EC_MKBP_FP_ENROLL_PROGRESS(event); CPRINTS("Enroll capture: %s (%d%%)", enroll_str[EC_MKBP_FP_ERRCODE(event) & 3], percent); @@ -810,7 +810,7 @@ DECLARE_CONSOLE_COMMAND_FLAGS(fpenroll, command_fpenroll, NULL, int command_fpmatch(int argc, char **argv) { enum ec_error_list rc = fp_console_action(FP_MODE_MATCH); - uint32_t event = atomic_read_clear(&fp_events); + uint32_t event = atomic_clear(&fp_events); if (rc == EC_SUCCESS && event & EC_MKBP_FP_MATCH) { uint32_t errcode = EC_MKBP_FP_ERRCODE(event); @@ -836,7 +836,7 @@ int command_fpclear(int argc, char **argv) if (rc < 0) CPRINTS("Failed to clear fingerprint context: %d", rc); - atomic_read_clear(&fp_events); + atomic_clear(&fp_events); return rc; } diff --git a/common/fpsensor/fpsensor_state.c b/common/fpsensor/fpsensor_state.c index ec4ddb4fd9..70568d8ec4 100644 --- a/common/fpsensor/fpsensor_state.c +++ b/common/fpsensor/fpsensor_state.c @@ -100,7 +100,7 @@ void fp_reset_and_clear_context(void) int fp_get_next_event(uint8_t *out) { - uint32_t event_out = atomic_read_clear(&fp_events); + uint32_t event_out = atomic_clear(&fp_events); memcpy(out, &event_out, sizeof(event_out)); |