cppcheck: reduce scope

Change-Id: Id3715b84a2328ca37fbc05d552fe58617ecfa78a
cppcheck: reduce scope

Change-Id: I9a2e2387eb1d436cd64c1ca00276fe9256ef0c04
cppcheck: fix var reassigned

Change-Id: I9db36a231ea846929f8860d089d77d0126242c26
cppcheck: fix var reassigned

Change-Id: I10bb64672d02626814c162b09b8bdd615f7fcad8
cppcheck: fix consecutive break

Change-Id: I028543f751ed8759f694cc4901d8c89d76867596