diff options
author | Andrea Grandi <agrandi@google.com> | 2022-03-07 17:18:08 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-03-14 22:15:28 +0000 |
commit | 67ad037a6d7d3c1d9505c0ba5e105431cdfdf5ee (patch) | |
tree | 88e24bd7a548c1292ad79dbc0192a6dfe30c3bb2 /common/fpsensor | |
parent | 92b8901bcbec05ca9d63e9744d03abc540400855 (diff) | |
download | chrome-ec-67ad037a6d7d3c1d9505c0ba5e105431cdfdf5ee.tar.gz |
fpsensor: Tidy up fp_match_success
Simplify logic and replace #ifdef with the compiler hint that
the function might not be used in certain builds (e.g. tests).
BRANCH=none
BUG=b:222592305
TEST=make buildall -j
Signed-off-by: Andrea Grandi <agrandi@google.com>
Change-Id: I8091cd2bd8e2770d9aa62a80a67d654ddfea1c75
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3508717
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'common/fpsensor')
-rw-r--r-- | common/fpsensor/fpsensor.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/common/fpsensor/fpsensor.c b/common/fpsensor/fpsensor.c index 4c9ef66cac..cc7b09ca08 100644 --- a/common/fpsensor/fpsensor.c +++ b/common/fpsensor/fpsensor.c @@ -80,18 +80,12 @@ static inline int is_raw_capture(uint32_t mode) || capture_type == FP_CAPTURE_QUALITY_TEST); } -#if defined(HAVE_FP_PRIVATE_DRIVER) || defined(CONFIG_CMD_FPSENSOR_DEBUG) -static bool fp_match_success(int match_result) +__maybe_unused static bool fp_match_success(int match_result) { - if (match_result == EC_MKBP_FP_ERR_MATCH_YES || - match_result == EC_MKBP_FP_ERR_MATCH_YES_UPDATED || - match_result == EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED) { - return true; - } - - return false; + return match_result == EC_MKBP_FP_ERR_MATCH_YES || + match_result == EC_MKBP_FP_ERR_MATCH_YES_UPDATED || + match_result == EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED; } -#endif #ifdef HAVE_FP_PRIVATE_DRIVER static inline int is_test_capture(uint32_t mode) |