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
TEST=make buildall -j
@@ -80,19 +80,13 @@ 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 ||
+ 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) {
- return true;
+ match_result == EC_MKBP_FP_ERR_MATCH_YES_UPDATE_FAILED;
}
- return false;
-}
-#endif
-
#ifdef HAVE_FP_PRIVATE_DRIVER
static inline int is_test_capture(uint32_t mode)
{
