cleanup: reduce scope of variables

Various things caught by cppcheck that are non-critical.

Change-Id: I495453c84bc15788b85036a163ee36b0ac601fa1
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/pid/zone.cpp b/pid/zone.cpp
index 92a332e..d5e2646 100644
--- a/pid/zone.cpp
+++ b/pid/zone.cpp
@@ -132,13 +132,15 @@
     static constexpr auto setpointpath = "/etc/thermal.d/set-point";
     try
     {
-        int value;
         std::ifstream ifs;
         ifs.open(setpointpath);
         if (ifs.good())
         {
+            int value;
             ifs >> value;
-            max = value; // expecting RPM set-point, not pwm%
+
+            /* expecting RPM set-point, not pwm% */
+            max = static_cast<float>(value);
         }
     }
     catch (const std::exception& e)