cppcheck: reduce scope

Change-Id: I06c97b99a55d8b291ea31e6a751ced01b0b80e23