main: further reduce brick list traversals

This commit is contained in:
Thomas Schoebel-Theuer 2020-03-07 07:46:17 +01:00
parent 19d20567fd
commit bef8f30ab1
2 changed files with 3 additions and 5 deletions

View File

@ -6353,10 +6353,6 @@ static int _main_thread(void *data)
}
MARS_DBG("kill any bricks (when possible) = %d\n", status);
status = mars_kill_brick_when_possible(mars_global,
NULL, false);
MARS_DBG("kill main bricks (when possible) = %d\n", status);
if ((long long)jiffies + mars_rollover_interval * HZ >= last_rollover) {
last_rollover = jiffies;
rollover_all();

View File

@ -2673,7 +2673,9 @@ restart:
}
this_type = type_list[index++];
}
if (!matches)
/* also kill any non-working bricks */
if (!matches &&
(brick->power.button || !brick->power.led_off))
continue;
}