cppcheck: reduce scope

Change-Id: I7a20f89e5a113c6c8760d51475d8198e28ad6aac