From a523fd6035bfa6d1c94dc730507286f9d92012b8 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Mon, 4 Feb 2019 08:50:10 -0800 Subject: [PATCH] lmdk: Remove redundant 'if' check We already know that "polling" must be non-zero at this point, because it hasn't been modified since our check on line 1960. So we remove this check for code clarity. Test: TreeHugger Change-Id: I069d9fd0eef70748a5333733dd0518d1ac8021b7 --- lmkd/lmkd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lmkd/lmkd.c b/lmkd/lmkd.c index 6cb059ee7..562e57867 100644 --- a/lmkd/lmkd.c +++ b/lmkd/lmkd.c @@ -1969,11 +1969,9 @@ static void mainloop(void) { clock_gettime(CLOCK_MONOTONIC_COARSE, &curr_tm); if (get_time_diff_ms(&last_report_tm, &curr_tm) >= PSI_POLL_PERIOD_MS) { - if (polling) { - polling--; - poll_handler->handler(poll_handler->data, 0); - last_report_tm = curr_tm; - } + polling--; + poll_handler->handler(poll_handler->data, 0); + last_report_tm = curr_tm; } } else { /* Wait for events with no timeout */