Simplify idle_loop()

No functional change
Merge remote-tracking branch 'upstream/master'