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
This commit is contained in:
Greg Kaiser 2019-02-04 08:50:10 -08:00
parent 55e3150842
commit 584f3fd35f
1 changed files with 3 additions and 5 deletions

8
lmkd.c
View File

@ -1969,11 +1969,9 @@ static void mainloop(void) {
clock_gettime(CLOCK_MONOTONIC_COARSE, &curr_tm); clock_gettime(CLOCK_MONOTONIC_COARSE, &curr_tm);
if (get_time_diff_ms(&last_report_tm, &curr_tm) >= PSI_POLL_PERIOD_MS) { if (get_time_diff_ms(&last_report_tm, &curr_tm) >= PSI_POLL_PERIOD_MS) {
if (polling) { polling--;
polling--; poll_handler->handler(poll_handler->data, 0);
poll_handler->handler(poll_handler->data, 0); last_report_tm = curr_tm;
last_report_tm = curr_tm;
}
} }
} else { } else {
/* Wait for events with no timeout */ /* Wait for events with no timeout */