cppcheck: reduce scope

Change-Id: If8220e82165d8ab85906584baa3827e3b6f5c2f4
cppcheck: reduce scope

Change-Id: I14956a86b8c83b9432c1eda511371beb026fd680
cppcheck: remove dups

Change-Id: I59622a66358a688caac36b7da220588dc2da440a