meson support: remove code warnings 1

This commit contains code changes necessary to support the increased
warning level from Meson builds. Most changes are for unused variables.

To keep the review size manageable, this commit contains only monitor
and presence changes (and top-level json_config.hpp).

Signed-off-by: Mike Capps <mikepcapps@gmail.com>
Change-Id: I7280b512c54e8d5aeba3300764a239f3dcbab14d
diff --git a/monitor/fan.cpp b/monitor/fan.cpp
index fa8b392..7bd1542 100644
--- a/monitor/fan.cpp
+++ b/monitor/fan.cpp
@@ -506,7 +506,7 @@
     }
 }
 
-void Fan::powerStateChanged(bool powerStateOn)
+void Fan::powerStateChanged([[maybe_unused]] bool powerStateOn)
 {
 #ifdef MONITOR_USE_JSON
     if (powerStateOn)
diff --git a/monitor/json_parser.cpp b/monitor/json_parser.cpp
index a46e2a9..1144998 100644
--- a/monitor/json_parser.cpp
+++ b/monitor/json_parser.cpp
@@ -198,7 +198,7 @@
         }
         // Valid deviation range is 0 - 100%
         auto deviation = fan["deviation"].get<size_t>();
-        if (deviation < 0 || 100 < deviation)
+        if (100 < deviation)
         {
             auto msg = fmt::format(
                 "Invalid deviation of {} found, must be between 0 and 100",
diff --git a/monitor/json_parser.hpp b/monitor/json_parser.hpp
index c6b64ec..7f09fd3 100644
--- a/monitor/json_parser.hpp
+++ b/monitor/json_parser.hpp
@@ -43,15 +43,13 @@
 /**
  * @brief Get the JSON object
  *
- * @param[in] bus - The dbus bus object
- *
  * @return JSON object
  *     A JSON object created after loading the JSON configuration file
  */
-inline const json getJsonObj(sdbusplus::bus::bus& bus)
+inline const json getJsonObj()
 {
     return fan::JsonConfig::load(
-        fan::JsonConfig::getConfFile(bus, confAppName, confFileName));
+        fan::JsonConfig::getConfFile(confAppName, confFileName));
 }
 
 /**
diff --git a/monitor/main.cpp b/monitor/main.cpp
index 0949c77..5ed0953 100644
--- a/monitor/main.cpp
+++ b/monitor/main.cpp
@@ -33,7 +33,7 @@
 
 using namespace phosphor::fan::monitor;
 
-int main(int argc, char* argv[])
+int main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[])
 {
     auto event = sdeventplus::Event::get_default();
     auto bus = sdbusplus::bus::new_default();
diff --git a/monitor/system.cpp b/monitor/system.cpp
index aff3bdc..6e2ccfa 100644
--- a/monitor/system.cpp
+++ b/monitor/system.cpp
@@ -84,7 +84,7 @@
 #ifdef MONITOR_USE_JSON
     try
     {
-        jsonObj = getJsonObj(_bus);
+        jsonObj = getJsonObj();
 #endif
         auto trustGrps = getTrustGroups(jsonObj);
         auto fanDefs = getFanDefinitions(jsonObj);
@@ -231,7 +231,7 @@
 }
 
 const std::vector<CreateGroupFunction>
-    System::getTrustGroups(const json& jsonObj)
+    System::getTrustGroups([[maybe_unused]] const json& jsonObj)
 {
 #ifdef MONITOR_USE_JSON
     return getTrustGrps(jsonObj);
@@ -245,7 +245,8 @@
     _trust = std::make_unique<trust::Manager>(groupFuncs);
 }
 
-const std::vector<FanDefinition> System::getFanDefinitions(const json& jsonObj)
+const std::vector<FanDefinition>
+    System::getFanDefinitions([[maybe_unused]] const json& jsonObj)
 {
 #ifdef MONITOR_USE_JSON
     return getFanDefs(jsonObj);
@@ -334,7 +335,7 @@
     }
 }
 
-void System::setFaultConfig(const json& jsonObj)
+void System::setFaultConfig([[maybe_unused]] const json& jsonObj)
 {
 #ifdef MONITOR_USE_JSON
     std::shared_ptr<PowerInterfaceBase> powerInterface =
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index 0ff1828..be56c69 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -70,11 +70,11 @@
     }
 }
 
-TachSensor::TachSensor(Mode mode, sdbusplus::bus::bus& bus, Fan& fan,
-                       const std::string& id, bool hasTarget, size_t funcDelay,
-                       const std::string& interface, double factor,
-                       int64_t offset, size_t method, size_t threshold,
-                       bool ignoreAboveMax, size_t timeout,
+TachSensor::TachSensor([[maybe_unused]] Mode mode, sdbusplus::bus::bus& bus,
+                       Fan& fan, const std::string& id, bool hasTarget,
+                       size_t funcDelay, const std::string& interface,
+                       double factor, int64_t offset, size_t method,
+                       size_t threshold, bool ignoreAboveMax, size_t timeout,
                        const std::optional<size_t>& errorDelay,
                        size_t countInterval, const sdeventplus::Event& event) :
     _bus(bus),