Commit 82f35775 authored by Aurelio Colosimo's avatar Aurelio Colosimo

run_all_state_machines: fix computation of least delay

This fixes a bug which was introduced in commit 75eb932e and found out
(together with the proposed solution) by Alessandro Rubini.
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 0c8ba26f
......@@ -25,7 +25,7 @@ static int run_all_state_machines(struct pp_globals *ppg)
delay_ms_j = pp_state_machine(ppi, NULL, 0);
/* delay_ms is the least delay_ms among all instances */
if (delay_ms == 0)
if (j == 0)
delay_ms = delay_ms_j;
else
delay_ms = delay_ms_j < delay_ms ? delay_ms_j : delay_ms;
......
......@@ -25,7 +25,7 @@ static int run_all_state_machines(struct pp_globals *ppg)
delay_ms_j = pp_state_machine(ppi, NULL, 0);
/* delay_ms is the least delay_ms among all instances */
if (delay_ms == 0)
if (j == 0)
delay_ms = delay_ms_j;
else
delay_ms = delay_ms_j < delay_ms ? delay_ms_j : delay_ms;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment