Driver: use more range-based for loops

Mechanical change converting some of the simpler for loops into range-based for
loops.  NFC.