From b7738370b75543870c4cbb15061b8e7b38887e9e Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Mon, 19 Sep 2022 09:48:09 -0700 Subject: [PATCH] Make large if() more readable. Change-Id: Ie43400387ab9f290e744ebaa09786612237e6c7e Signed-off-by: Tim Newsome --- src/target/target.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/target/target.c b/src/target/target.c index 5e2fe8cda..5867149a7 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -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 */