Make large if() more readable.

Change-Id: Ie43400387ab9f290e744ebaa09786612237e6c7e
Signed-off-by: Tim Newsome <tim@sifive.com>
This commit is contained in:
Tim Newsome 2022-09-19 09:48:09 -07:00
parent fa1abc63d2
commit b7738370b7
1 changed files with 2 additions and 4 deletions

View File

@ -3050,10 +3050,8 @@ static int handle_target(void *priv)
* allow some slack in the time comparison. Otherwise, if we
* schedule for now+polling_interval, the next poll won't
* actually happen until a polling_interval later. */
if (!target->tap->enabled ||
power_dropout ||
srst_asserted ||
timeval_ms() + polling_interval / 2 < target->backoff.next_attempt)
const bool poll_needed = timeval_ms() + polling_interval / 2 >= target->backoff.next_attempt;
if (!target->tap->enabled || power_dropout || srst_asserted || !poll_needed)
continue;
/* polling may fail silently until the target has been examined */