diff --git a/redfish-core/include/node.hpp b/redfish-core/include/node.hpp
index b21fba5..797160d 100644
--- a/redfish-core/include/node.hpp
+++ b/redfish-core/include/node.hpp
@@ -53,7 +53,7 @@
 {
   public:
     template <typename... Params>
-    Node(App& app, std::string&& entityUrl, Params... paramsIn)
+    Node(App& app, std::string&& entityUrl, [[maybe_unused]] Params... paramsIn)
     {
         crow::DynamicRule& get = app.routeDynamic(entityUrl.c_str());
         getRule = &get;
@@ -157,36 +157,36 @@
 
   protected:
     // Node is designed to be an abstract class, so doGet is pure virtual
-    virtual void doGet(crow::Response& res, const crow::Request& req,
-                       const std::vector<std::string>& params)
+    virtual void doGet(crow::Response& res, const crow::Request&,
+                       const std::vector<std::string>&)
     {
         res.result(boost::beast::http::status::method_not_allowed);
         res.end();
     }
 
-    virtual void doPatch(crow::Response& res, const crow::Request& req,
-                         const std::vector<std::string>& params)
+    virtual void doPatch(crow::Response& res, const crow::Request&,
+                         const std::vector<std::string>&)
     {
         res.result(boost::beast::http::status::method_not_allowed);
         res.end();
     }
 
-    virtual void doPost(crow::Response& res, const crow::Request& req,
-                        const std::vector<std::string>& params)
+    virtual void doPost(crow::Response& res, const crow::Request&,
+                        const std::vector<std::string>&)
     {
         res.result(boost::beast::http::status::method_not_allowed);
         res.end();
     }
 
-    virtual void doPut(crow::Response& res, const crow::Request& req,
-                       const std::vector<std::string>& params)
+    virtual void doPut(crow::Response& res, const crow::Request&,
+                       const std::vector<std::string>&)
     {
         res.result(boost::beast::http::status::method_not_allowed);
         res.end();
     }
 
-    virtual void doDelete(crow::Response& res, const crow::Request& req,
-                          const std::vector<std::string>& params)
+    virtual void doDelete(crow::Response& res, const crow::Request&,
+                          const std::vector<std::string>&)
     {
         res.result(boost::beast::http::status::method_not_allowed);
         res.end();
diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp
index d9bf1fc..2d44545 100644
--- a/redfish-core/include/privileges.hpp
+++ b/redfish-core/include/privileges.hpp
@@ -309,7 +309,7 @@
  */
 inline bool isMethodAllowedForUser(const boost::beast::http::verb method,
                                    const OperationMap& operationMap,
-                                   const std::string& user)
+                                   const std::string&)
 {
     // TODO: load user privileges from configuration as soon as its available
     // now we are granting all privileges to everyone.
diff --git a/redfish-core/include/server_sent_events.hpp b/redfish-core/include/server_sent_events.hpp
index 9f0da8f..ada5da7 100644
--- a/redfish-core/include/server_sent_events.hpp
+++ b/redfish-core/include/server_sent_events.hpp
@@ -107,8 +107,9 @@
 
         sseConn->async_write_some(
             boost::asio::buffer(outBuffer.data(), outBuffer.size()),
-            [self(shared_from_this())](boost::beast::error_code ec,
-                                       const std::size_t& bytesTransferred) {
+            [self(shared_from_this())](
+                boost::beast::error_code ec,
+                [[maybe_unused]] const std::size_t& bytesTransferred) {
                 self->outBuffer.erase(0, bytesTransferred);
 
                 if (ec == boost::asio::error::eof)
@@ -131,7 +132,6 @@
                 }
                 BMCWEB_LOG_DEBUG << "async_write_some() bytes transferred: "
                                  << bytesTransferred;
-                boost::ignore_unused(bytesTransferred);
 
                 self->doWrite();
             });
@@ -164,8 +164,9 @@
 
         boost::beast::http::async_write_header(
             *sseConn, *serializer,
-            [this, response, serializer](const boost::beast::error_code& ec,
-                                         const std::size_t& bytesTransferred) {
+            [this, response,
+             serializer](const boost::beast::error_code& ec,
+                         [[maybe_unused]] const std::size_t& bytesTransferred) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR << "Error sending header" << ec;
diff --git a/redfish-core/include/utils/json_utils.hpp b/redfish-core/include/utils/json_utils.hpp
index d578de4..c4f54d7 100644
--- a/redfish-core/include/utils/json_utils.hpp
+++ b/redfish-core/include/utils/json_utils.hpp
@@ -86,8 +86,7 @@
 };
 
 template <typename ToType, typename FromType>
-bool checkRange(const FromType& from, nlohmann::json& jsonValue,
-                const std::string& key)
+bool checkRange(const FromType& from, const std::string& key)
 {
     if (from > std::numeric_limits<ToType>::max())
     {
@@ -137,7 +136,7 @@
         {
             return UnpackErrorCode::invalidType;
         }
-        if (!checkRange<Type>(*jsonPtr, jsonValue, key))
+        if (!checkRange<Type>(*jsonPtr, key))
         {
             return UnpackErrorCode::outOfRange;
         }
@@ -151,7 +150,7 @@
         {
             return UnpackErrorCode::invalidType;
         }
-        if (!checkRange<Type>(*jsonPtr, jsonValue, key))
+        if (!checkRange<Type>(*jsonPtr, key))
         {
             return UnpackErrorCode::outOfRange;
         }
@@ -166,7 +165,7 @@
         {
             return UnpackErrorCode::invalidType;
         }
-        if (!checkRange<Type>(*jsonPtr, jsonValue, key))
+        if (!checkRange<Type>(*jsonPtr, key))
         {
             return UnpackErrorCode::outOfRange;
         }
@@ -326,8 +325,8 @@
 }
 
 template <size_t Count, size_t Index>
-bool readJsonValues(const std::string& key, nlohmann::json& jsonValue,
-                    crow::Response& res, std::bitset<Count>& handled)
+bool readJsonValues(const std::string& key, nlohmann::json&,
+                    crow::Response& res, std::bitset<Count>&)
 {
     BMCWEB_LOG_DEBUG << "Unable to find variable for key" << key;
     messages::propertyUnknown(res, key);
@@ -356,7 +355,7 @@
 }
 
 template <size_t Index = 0, size_t Count>
-bool handleMissing(std::bitset<Count>& handled, crow::Response& res)
+bool handleMissing(std::bitset<Count>&, crow::Response&)
 {
     return true;
 }
@@ -364,7 +363,7 @@
 template <size_t Index = 0, size_t Count, typename ValueType,
           typename... UnpackTypes>
 bool handleMissing(std::bitset<Count>& handled, crow::Response& res,
-                   const char* key, ValueType& unused, UnpackTypes&... in)
+                   const char* key, ValueType&, UnpackTypes&... in)
 {
     bool ret = true;
     if (!handled.test(Index) && !is_optional_v<ValueType>)
diff --git a/redfish-core/lib/account_service.hpp b/redfish-core/lib/account_service.hpp
index b8517b4..fae181c 100644
--- a/redfish-core/lib/account_service.hpp
+++ b/redfish-core/lib/account_service.hpp
@@ -965,8 +965,6 @@
 
     void handleLDAPPatch(nlohmann::json& input,
                          const std::shared_ptr<AsyncResp>& asyncResp,
-                         const crow::Request& req,
-                         const std::vector<std::string>& params,
                          const std::string& serverType)
     {
         std::string dbusObjectPath;
@@ -978,6 +976,10 @@
         {
             dbusObjectPath = ldapConfigObjectName;
         }
+        else
+        {
+            return;
+        }
 
         std::optional<nlohmann::json> authentication;
         std::optional<nlohmann::json> ldapService;
@@ -1121,8 +1123,8 @@
         });
     }
 
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         const persistent_data::AuthConfigMethods& authMethodsConfig =
             persistent_data::SessionStore::getInstance().getAuthMethodsConfig();
@@ -1210,6 +1212,10 @@
 
         auto callback = [asyncResp](bool success, LDAPConfigData& confData,
                                     const std::string& ldapType) {
+            if (!success)
+            {
+                return;
+            }
             parseLDAPConfigData(asyncResp->res.jsonValue, confData, ldapType);
         };
 
@@ -1218,7 +1224,7 @@
     }
 
     void doPatch(crow::Response& res, const crow::Request& req,
-                 const std::vector<std::string>& params) override
+                 const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -1252,7 +1258,7 @@
 
         if (ldapObject)
         {
-            handleLDAPPatch(*ldapObject, asyncResp, req, params, "LDAP");
+            handleLDAPPatch(*ldapObject, asyncResp, "LDAP");
         }
 
         if (std::optional<nlohmann::json> oemOpenBMCObject;
@@ -1273,7 +1279,7 @@
 
         if (activeDirectoryObject)
         {
-            handleLDAPPatch(*activeDirectoryObject, asyncResp, req, params,
+            handleLDAPPatch(*activeDirectoryObject, asyncResp,
                             "ActiveDirectory");
         }
 
@@ -1337,7 +1343,7 @@
 
   private:
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         res.jsonValue = {{"@odata.id", "/redfish/v1/AccountService/Accounts"},
@@ -1393,7 +1399,7 @@
             "org.freedesktop.DBus.ObjectManager", "GetManagedObjects");
     }
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -1886,7 +1892,7 @@
             });
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
diff --git a/redfish-core/lib/bios.hpp b/redfish-core/lib/bios.hpp
index b997ad4..8acf29b 100644
--- a/redfish-core/lib/bios.hpp
+++ b/redfish-core/lib/bios.hpp
@@ -17,8 +17,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -55,8 +55,8 @@
      * Function handles POST method request.
      * Analyzes POST body message before sends Reset request data to D-Bus.
      */
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
diff --git a/redfish-core/lib/certificate_service.hpp b/redfish-core/lib/certificate_service.hpp
index e237fd3..35c60b1 100644
--- a/redfish-core/lib/certificate_service.hpp
+++ b/redfish-core/lib/certificate_service.hpp
@@ -68,8 +68,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.type", "#CertificateService.v1_0_0.CertificateService"},
@@ -261,7 +261,7 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         static const int RSA_KEY_BIT_LENGTH = 2048;
         auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -479,7 +479,7 @@
             });
         crow::connections::systemBus->async_method_call(
             [asyncResp](const boost::system::error_code& ec,
-                        const std::string& path) {
+                        const std::string&) {
                 if (ec)
                 {
                     BMCWEB_LOG_ERROR << "DBUS response error: " << ec.message();
@@ -699,7 +699,7 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         std::string certificate;
         nlohmann::json certificateUri;
@@ -866,8 +866,8 @@
             {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
             {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
     }
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.id",
@@ -907,7 +907,7 @@
     }
 
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "HTTPSCertificateCollection::doPost";
         auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -978,8 +978,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.id",
@@ -1066,8 +1066,8 @@
             {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
             {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
     }
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.id", "/redfish/v1/AccountService/LDAP/Certificates"},
@@ -1105,7 +1105,7 @@
     }
 
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         std::string certFileBody = getCertificateFromReqBody(asyncResp, req);
@@ -1172,7 +1172,7 @@
     }
 
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         long id = getIDFromURL(req.url);
@@ -1209,8 +1209,8 @@
             {boost::beast::http::verb::delete_, {{"ConfigureComponents"}}},
             {boost::beast::http::verb::post, {{"ConfigureComponents"}}}};
     }
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.id", "/redfish/v1/Managers/bmc/Truststore/Certificates/"},
@@ -1249,7 +1249,7 @@
     }
 
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         std::string certFileBody = getCertificateFromReqBody(asyncResp, req);
@@ -1316,7 +1316,7 @@
     }
 
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         long id = getIDFromURL(req.url);
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 10b0798..c7db370 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -175,8 +175,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#ChassisCollection.ChassisCollection";
         res.jsonValue["@odata.id"] = "/redfish/v1/Chassis";
@@ -242,7 +242,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         const std::array<const char*, 2> interfaces = {
@@ -356,6 +356,11 @@
                             const boost::system::error_code ec2,
                             const std::vector<std::pair<
                                 std::string, VariantType>>& propertiesList) {
+                            if (ec2)
+                            {
+                                return;
+                            }
+
                             for (const std::pair<std::string, VariantType>&
                                      property : propertiesList)
                             {
@@ -570,7 +575,7 @@
      * Analyzes POST body before sending Reset request data to D-Bus.
      */
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "Post Chassis Reset.";
 
@@ -621,7 +626,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         if (params.size() != 1)
diff --git a/redfish-core/lib/cpudimm.hpp b/redfish-core/lib/cpudimm.hpp
index b4178b4..7b5ca43 100644
--- a/redfish-core/lib/cpudimm.hpp
+++ b/redfish-core/lib/cpudimm.hpp
@@ -1050,8 +1050,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] =
             "#ProcessorCollection.ProcessorCollection";
@@ -1088,7 +1088,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         // Check if there is required param, truly entering this shall be
@@ -1135,8 +1135,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#MemoryCollection.MemoryCollection";
         res.jsonValue["Name"] = "Memory Module Collection";
@@ -1170,7 +1170,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         // Check if there is required param, truly entering this shall be
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 852b3b7..babfd4a 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -731,9 +731,8 @@
  *
  * @return None
  */
-inline void createIPv4(const std::string& ifaceId, unsigned int ipIdx,
-                       uint8_t prefixLength, const std::string& gateway,
-                       const std::string& address,
+inline void createIPv4(const std::string& ifaceId, uint8_t prefixLength,
+                       const std::string& gateway, const std::string& address,
                        std::shared_ptr<AsyncResp> asyncResp)
 {
     crow::connections::systemBus->async_method_call(
@@ -1019,8 +1018,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] =
             "#EthernetInterfaceCollection.EthernetInterfaceCollection";
@@ -1551,8 +1550,8 @@
                 }
                 else
                 {
-                    createIPv4(ifaceId, entryIdx, prefixLength, *gateway,
-                               *address, asyncResp);
+                    createIPv4(ifaceId, prefixLength, *gateway, *address,
+                               asyncResp);
                 }
                 entryIdx++;
             }
@@ -1868,7 +1867,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2079,11 +2078,10 @@
     }
 
   private:
-    void parseInterfaceData(
-        nlohmann::json& json_response, const std::string& parent_iface_id,
-        const std::string& iface_id, const EthernetInterfaceData& ethData,
-        const boost::container::flat_set<IPv4AddressData>& ipv4Data,
-        const boost::container::flat_set<IPv6AddressData>& ipv6Data)
+    void parseInterfaceData(nlohmann::json& json_response,
+                            const std::string& parent_iface_id,
+                            const std::string& iface_id,
+                            const EthernetInterfaceData& ethData)
     {
         // Fill out obvious data...
         json_response["Id"] = iface_id;
@@ -2113,7 +2111,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2146,13 +2144,12 @@
             [this, asyncResp, parent_iface_id{std::string(params[0])},
              iface_id{std::string(params[1])}](
                 const bool& success, const EthernetInterfaceData& ethData,
-                const boost::container::flat_set<IPv4AddressData>& ipv4Data,
-                const boost::container::flat_set<IPv6AddressData>& ipv6Data) {
+                const boost::container::flat_set<IPv4AddressData>&,
+                const boost::container::flat_set<IPv6AddressData>&) {
                 if (success && ethData.vlan_id.size() != 0)
                 {
                     parseInterfaceData(asyncResp->res.jsonValue,
-                                       parent_iface_id, iface_id, ethData,
-                                       ipv4Data, ipv6Data);
+                                       parent_iface_id, iface_id, ethData);
                 }
                 else
                 {
@@ -2199,10 +2196,10 @@
         getEthernetIfaceData(
             params[1],
             [asyncResp, parentIfaceId{std::string(params[0])},
-             ifaceId{std::string(params[1])}, &vlanEnable, &vlanId](
-                const bool& success, const EthernetInterfaceData& ethData,
-                const boost::container::flat_set<IPv4AddressData>& ipv4Data,
-                const boost::container::flat_set<IPv6AddressData>& ipv6Data) {
+             ifaceId{std::string(params[1])}, &vlanEnable,
+             &vlanId](const bool& success, const EthernetInterfaceData& ethData,
+                      const boost::container::flat_set<IPv4AddressData>&,
+                      const boost::container::flat_set<IPv6AddressData>&) {
                 if (success && !ethData.vlan_id.empty())
                 {
                     auto callback =
@@ -2244,7 +2241,7 @@
             });
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2271,8 +2268,8 @@
             [asyncResp, parentIfaceId{std::string(params[0])},
              ifaceId{std::string(params[1])}](
                 const bool& success, const EthernetInterfaceData& ethData,
-                const boost::container::flat_set<IPv4AddressData>& ipv4Data,
-                const boost::container::flat_set<IPv6AddressData>& ipv6Data) {
+                const boost::container::flat_set<IPv4AddressData>&,
+                const boost::container::flat_set<IPv6AddressData>&) {
                 if (success && !ethData.vlan_id.empty())
                 {
                     auto callback =
@@ -2323,7 +2320,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
diff --git a/redfish-core/lib/event_service.hpp b/redfish-core/lib/event_service.hpp
index fa06fcf..7d17cea 100644
--- a/redfish-core/lib/event_service.hpp
+++ b/redfish-core/lib/event_service.hpp
@@ -51,8 +51,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         res.jsonValue = {
@@ -92,7 +92,7 @@
     }
 
     void doPatch(crow::Response& res, const crow::Request& req,
-                 const std::vector<std::string>& params) override
+                 const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -167,8 +167,8 @@
     }
 
   private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         EventServiceManager::getInstance().sendTestEventLog();
         res.result(boost::beast::http::status::no_content);
@@ -192,8 +192,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -219,7 +219,7 @@
     }
 
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -464,7 +464,7 @@
 
   private:
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         if (EventServiceManager::getInstance().getNumberOfSubscriptions() >=
             maxNoOfSubscriptions)
@@ -569,7 +569,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -674,7 +674,7 @@
         EventServiceManager::getInstance().updateSubscriptionData();
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
diff --git a/redfish-core/lib/hypervisor_ethernet.hpp b/redfish-core/lib/hypervisor_ethernet.hpp
index f0955b2..3266069 100644
--- a/redfish-core/lib/hypervisor_ethernet.hpp
+++ b/redfish-core/lib/hypervisor_ethernet.hpp
@@ -34,13 +34,13 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         crow::connections::systemBus->async_method_call(
             [asyncResp](const boost::system::error_code ec,
-                        const std::variant<std::string>& hostName) {
+                        const std::variant<std::string>& /*hostName*/) {
                 if (ec)
                 {
                     messages::resourceNotFound(asyncResp->res, "System",
@@ -90,8 +90,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         const std::array<const char*, 1> interfaces = {
@@ -399,7 +399,6 @@
  * @return None.
  */
 inline void setHypervisorIPv4Gateway(std::shared_ptr<AsyncResp> aResp,
-                                     const std::string& ethIfaceId,
                                      const std::string& gateway)
 {
     BMCWEB_LOG_DEBUG
@@ -439,7 +438,7 @@
                                  std::shared_ptr<AsyncResp> asyncResp)
 {
     setHypervisorIPv4Address(asyncResp, ifaceId, address);
-    setHypervisorIPv4Gateway(asyncResp, ifaceId, gateway);
+    setHypervisorIPv4Gateway(asyncResp, gateway);
     setHypervisorIPv4Subnet(asyncResp, ifaceId, prefixLength);
 }
 
@@ -458,7 +457,7 @@
     std::string gateway = "0.0.0.0";
     const uint8_t prefixLength = 0;
     setHypervisorIPv4Address(asyncResp, ifaceId, address);
-    setHypervisorIPv4Gateway(asyncResp, ifaceId, gateway);
+    setHypervisorIPv4Gateway(asyncResp, gateway);
     setHypervisorIPv4Subnet(asyncResp, ifaceId, prefixLength);
 }
 
@@ -744,7 +743,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -822,7 +821,7 @@
              ipv4DHCPEnabled = std::move(ipv4DHCPEnabled),
              dhcpv4 = std::move(dhcpv4)](
                 const bool& success, const EthernetInterfaceData& ethData,
-                const boost::container::flat_set<IPv4AddressData>& ipv4Data) {
+                const boost::container::flat_set<IPv4AddressData>&) {
                 if (!success)
                 {
                     messages::resourceNotFound(asyncResp->res,
diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp
index a2a5bc9..f9e0c47 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -120,8 +120,7 @@
     }
 
     crow::connections::systemBus->async_method_call(
-        [aResp, ledOn, ledBlinkng](const boost::system::error_code ec,
-                                   const std::variant<bool> asserted) mutable {
+        [aResp, ledOn, ledBlinkng](const boost::system::error_code ec) mutable {
             if (ec)
             {
                 // Some systems may not have enclosure_identify_blink object so
@@ -133,8 +132,7 @@
                 }
             }
             crow::connections::systemBus->async_method_call(
-                [aResp](const boost::system::error_code ec2,
-                        const std::variant<bool> asserted2) {
+                [aResp](const boost::system::error_code ec2) {
                     if (ec2)
                     {
                         BMCWEB_LOG_DEBUG << "DBUS response error " << ec2;
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index a4a873a..c4106b0 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -730,9 +730,14 @@
                                    const std::string& dumpType)
 {
     std::shared_ptr<task::TaskData> task = task::TaskData::createTask(
-        [dumpId, dumpPath, dumpType](
+        [dumpId, dumpPath, dumpType, asyncResp](
             boost::system::error_code err, sdbusplus::message::message& m,
             const std::shared_ptr<task::TaskData>& taskData) {
+            if (err)
+            {
+                messages::internalError(asyncResp->res);
+                return false;
+            }
             std::vector<std::pair<
                 std::string,
                 std::vector<std::pair<std::string, std::variant<std::string>>>>>
@@ -946,8 +951,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         // Collections don't include the static data added by SubRoute because
@@ -1023,8 +1028,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -1063,8 +1068,8 @@
     }
 
   private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -1211,7 +1216,7 @@
 
   private:
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         uint64_t skip = 0;
@@ -1313,7 +1318,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -1388,8 +1393,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -1530,7 +1535,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -1626,7 +1631,7 @@
             "xyz.openbmc_project.Logging.Entry");
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
 
@@ -1687,8 +1692,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         // Collections don't include the static data added by SubRoute because
@@ -1731,8 +1736,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         asyncResp->res.jsonValue["@odata.type"] =
@@ -1812,7 +1817,7 @@
 
   private:
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         static constexpr const long maxEntriesPerPage = 1000;
@@ -1915,7 +1920,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2001,8 +2006,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -2047,8 +2052,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -2081,7 +2086,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2093,7 +2098,7 @@
         getDumpEntryById(asyncResp, params[0], "BMC");
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2125,7 +2130,7 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         createDump(res, req, "BMC");
     }
@@ -2179,8 +2184,8 @@
     }
 
   private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         clearDump(res, "xyz.openbmc_project.Dump.Entry.BMC");
     }
@@ -2202,8 +2207,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -2249,8 +2254,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -2283,7 +2288,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2295,7 +2300,7 @@
         getDumpEntryById(asyncResp, params[0], "System");
     }
 
-    void doDelete(crow::Response& res, const crow::Request& req,
+    void doDelete(crow::Response& res, const crow::Request&,
                   const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2327,7 +2332,7 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         createDump(res, req, "System");
     }
@@ -2382,8 +2387,8 @@
     }
 
   private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         clearDump(res, "xyz.openbmc_project.Dump.Entry.System");
     }
@@ -2410,8 +2415,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         // Copy over the static data to include the entries added by SubRoute
@@ -2467,14 +2472,14 @@
     }
 
   private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
         crow::connections::systemBus->async_method_call(
             [asyncResp](const boost::system::error_code ec,
-                        const std::string& resp) {
+                        const std::string&) {
                 if (ec)
                 {
                     messages::internalError(asyncResp->res);
@@ -2562,8 +2567,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         // Collections don't include the static data added by SubRoute because
@@ -2646,7 +2651,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2681,7 +2686,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -2784,14 +2789,14 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
         auto generateonDemandLogCallback = [asyncResp,
                                             req](const boost::system::error_code
                                                      ec,
-                                                 const std::string& resp) {
+                                                 const std::string&) {
             if (ec)
             {
                 if (ec.value() == boost::system::errc::operation_not_supported)
@@ -2856,14 +2861,14 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
         auto generateTelemetryLogCallback = [asyncResp, req](
                                                 const boost::system::error_code
                                                     ec,
-                                                const std::string& resp) {
+                                                const std::string&) {
             if (ec)
             {
                 if (ec.value() == boost::system::errc::operation_not_supported)
@@ -2928,7 +2933,7 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         std::vector<std::vector<uint8_t>> peciCommands;
@@ -3026,8 +3031,8 @@
      * The Clear Log actions does not require any parameter.The action deletes
      * all entries found in the Entries collection for this Log Service.
      */
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "Do delete all entries.";
 
@@ -3075,8 +3080,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -3114,8 +3119,8 @@
     }
 
   private:
-    void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+    void doPost(crow::Response& res, const crow::Request&,
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "Do delete all postcodes entries.";
 
@@ -3393,7 +3398,7 @@
 
   private:
     void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -3442,7 +3447,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp
index a113ba1..56abdcf 100644
--- a/redfish-core/lib/managers.hpp
+++ b/redfish-core/lib/managers.hpp
@@ -87,7 +87,7 @@
      * OpenBMC only supports ResetType "GracefulRestart".
      */
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "Post Manager Reset.";
 
@@ -139,7 +139,7 @@
      * OpenBMC only supports ResetToDefaultsType "ResetAll".
      */
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "Post ResetToDefaults.";
 
@@ -210,8 +210,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.type", "#ActionInfo.v1_1_2.ActionInfo"},
@@ -1372,11 +1372,11 @@
                 const std::string& owner = subtree[0].second[0].first;
                 crow::connections::systemBus->async_method_call(
                     [self, path, owner](
-                        const boost::system::error_code ec,
+                        const boost::system::error_code ec2,
                         const boost::container::flat_map<
                             std::string, std::variant<std::vector<std::string>,
                                                       std::string>>& r) {
-                        if (ec)
+                        if (ec2)
                         {
                             BMCWEB_LOG_ERROR << "SetPIDValues: Can't get "
                                                 "thermalModeIface "
@@ -1673,8 +1673,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.id"] = "/redfish/v1/Managers/bmc";
         res.jsonValue["@odata.type"] = "#Manager.v1_9_0.Manager";
@@ -1806,7 +1806,7 @@
     }
 
     void doPatch(crow::Response& res, const crow::Request& req,
-                 const std::vector<std::string>& params) override
+                 const std::vector<std::string>&) override
     {
         std::optional<nlohmann::json> oem;
         std::optional<nlohmann::json> links;
@@ -2088,8 +2088,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         // Collections don't include the static data added by SubRoute
         // because it has a duplicate entry for members
diff --git a/redfish-core/lib/message_registries.hpp b/redfish-core/lib/message_registries.hpp
index 63aa5f3..77fc10e 100644
--- a/redfish-core/lib/message_registries.hpp
+++ b/redfish-core/lib/message_registries.hpp
@@ -44,8 +44,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         // Collections don't include the static data added by SubRoute because
         // it has a duplicate entry for members
@@ -83,7 +83,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         if (params.size() != 1)
@@ -169,7 +169,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         if (params.size() != 2)
diff --git a/redfish-core/lib/network_protocol.hpp b/redfish-core/lib/network_protocol.hpp
index 4d612fc..75e3aa8 100644
--- a/redfish-core/lib/network_protocol.hpp
+++ b/redfish-core/lib/network_protocol.hpp
@@ -143,8 +143,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -168,6 +168,11 @@
         crow::connections::systemBus->async_method_call(
             [asyncResp](const boost::system::error_code error_code,
                         const std::variant<std::string>& timeSyncMethod) {
+                if (error_code)
+                {
+                    return;
+                }
+
                 const std::string* s =
                     std::get_if<std::string>(&timeSyncMethod);
 
@@ -404,7 +409,12 @@
         }
 
         crow::connections::systemBus->async_method_call(
-            [asyncResp](const boost::system::error_code error_code) {},
+            [asyncResp](const boost::system::error_code error_code) {
+                if (error_code)
+                {
+                    messages::internalError(asyncResp->res);
+                }
+            },
             "xyz.openbmc_project.Settings",
             "/xyz/openbmc_project/time/sync_method",
             "org.freedesktop.DBus.Properties", "Set",
@@ -488,7 +498,7 @@
     }
 
     void doPatch(crow::Response& res, const crow::Request& req,
-                 const std::vector<std::string>& params) override
+                 const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         std::optional<std::string> newHostName;
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index e2f3591..21ec6dc 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -88,8 +88,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         asyncResp->res.jsonValue = {
@@ -120,7 +120,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -208,7 +208,7 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
@@ -301,7 +301,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
diff --git a/redfish-core/lib/power.hpp b/redfish-core/lib/power.hpp
index 031657a..ffe0ed5 100644
--- a/redfish-core/lib/power.hpp
+++ b/redfish-core/lib/power.hpp
@@ -139,7 +139,7 @@
             };
         getValidChassisPath(asyncResp, std::move(getChassisPath));
     }
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         if (params.size() != 1)
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp
index e54492d..1d8e3c4 100644
--- a/redfish-core/lib/redfish_sessions.hpp
+++ b/redfish-core/lib/redfish_sessions.hpp
@@ -41,7 +41,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         // Note that control also reaches here via doPost and doDelete.
@@ -145,8 +145,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::vector<const std::string*> sessionIds =
             persistent_data::SessionStore::getInstance().getUniqueIds(
@@ -168,7 +168,7 @@
     }
 
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         std::string username;
         std::string password;
@@ -275,8 +275,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#SessionService.v1_0_2.SessionService";
         res.jsonValue["@odata.id"] = "/redfish/v1/SessionService/";
diff --git a/redfish-core/lib/roles.hpp b/redfish-core/lib/roles.hpp
index 9c86d4b..610c086 100644
--- a/redfish-core/lib/roles.hpp
+++ b/redfish-core/lib/roles.hpp
@@ -86,7 +86,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         if (params.size() != 1)
@@ -133,8 +133,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         res.jsonValue = {{"@odata.id", "/redfish/v1/AccountService/Roles"},
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index d1895c4..ac98735 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -304,7 +304,7 @@
     auto objectsWithConnectionCb =
         [callback](const boost::container::flat_set<std::string>& connections,
                    const std::set<std::pair<std::string, std::string>>&
-                       objectsWithConnection) {
+                   /*objectsWithConnection*/) {
             callback(std::move(connections));
         };
     getObjectsWithConnection(SensorsAsyncResp, sensorNames,
@@ -2770,7 +2770,7 @@
         // Get the connection to which the memberId belongs
         auto getObjectsWithConnectionCb =
             [sensorAsyncResp, overrideMap](
-                const boost::container::flat_set<std::string>& connections,
+                const boost::container::flat_set<std::string>& /*connections*/,
                 const std::set<std::pair<std::string, std::string>>&
                     objectsWithConnection) {
                 if (objectsWithConnection.size() != overrideMap.size())
@@ -3012,7 +3012,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         BMCWEB_LOG_DEBUG << "SensorCollection doGet enter";
@@ -3084,7 +3084,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         BMCWEB_LOG_DEBUG << "Sensor doGet enter";
diff --git a/redfish-core/lib/service_root.hpp b/redfish-core/lib/service_root.hpp
index 52e899e..629280c 100644
--- a/redfish-core/lib/service_root.hpp
+++ b/redfish-core/lib/service_root.hpp
@@ -38,8 +38,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#ServiceRoot.v1_5_0.ServiceRoot";
         res.jsonValue["@odata.id"] = "/redfish/v1";
diff --git a/redfish-core/lib/storage.hpp b/redfish-core/lib/storage.hpp
index 9b1e2d7..ccd8ab8 100644
--- a/redfish-core/lib/storage.hpp
+++ b/redfish-core/lib/storage.hpp
@@ -38,8 +38,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#StorageCollection.StorageCollection";
         res.jsonValue["@odata.id"] = "/redfish/v1/Systems/system/Storage";
@@ -66,8 +66,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#Storage.v1_7_1.Storage";
         res.jsonValue["@odata.id"] = "/redfish/v1/Systems/system/Storage/1";
@@ -289,7 +289,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -353,12 +353,12 @@
 
                 const std::string& connectionName = connectionNames[0].first;
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp](const boost::system::error_code ec,
+                    [asyncResp](const boost::system::error_code ec2,
                                 const std::vector<std::pair<
                                     std::string,
                                     std::variant<bool, std::string, uint64_t>>>&
                                     propertiesList) {
-                        if (ec)
+                        if (ec2)
                         {
                             // this interface isn't necessary
                             return;
@@ -400,11 +400,11 @@
                 health->populate();
 
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp, path](const boost::system::error_code ec,
+                    [asyncResp, path](const boost::system::error_code ec2,
                                       const std::variant<bool> present) {
                         // this interface isn't necessary, only check it if we
                         // get a good return
-                        if (ec)
+                        if (ec2)
                         {
                             return;
                         }
@@ -425,11 +425,11 @@
                     "Get", "xyz.openbmc_project.Inventory.Item", "Present");
 
                 crow::connections::systemBus->async_method_call(
-                    [asyncResp](const boost::system::error_code ec,
+                    [asyncResp](const boost::system::error_code ec2,
                                 const std::variant<bool> rebuilding) {
                         // this interface isn't necessary, only check it if we
                         // get a good return
-                        if (ec)
+                        if (ec2)
                         {
                             return;
                         }
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp
index c4bc3d4..fb1288e 100644
--- a/redfish-core/lib/systems.hpp
+++ b/redfish-core/lib/systems.hpp
@@ -202,14 +202,14 @@
                             crow::connections::systemBus->async_method_call(
                                 [aResp, service{connection.first},
                                  path(std::move(path))](
-                                    const boost::system::error_code ec,
+                                    const boost::system::error_code ec2,
                                     const std::vector<
                                         std::pair<std::string, VariantType>>&
                                         properties) {
-                                    if (ec)
+                                    if (ec2)
                                     {
                                         BMCWEB_LOG_ERROR
-                                            << "DBUS response error " << ec;
+                                            << "DBUS response error " << ec2;
                                         messages::internalError(aResp->res);
                                         return;
                                     }
@@ -268,15 +268,15 @@
                                         auto getDimmProperties =
                                             [aResp](
                                                 const boost::system::error_code
-                                                    ec,
+                                                    ec3,
                                                 const std::variant<bool>&
                                                     dimmState) {
-                                                if (ec)
+                                                if (ec3)
                                                 {
                                                     BMCWEB_LOG_ERROR
                                                         << "DBUS response "
                                                            "error "
-                                                        << ec;
+                                                        << ec3;
                                                     return;
                                                 }
                                                 updateDimmProperties(aResp,
@@ -309,14 +309,14 @@
                             crow::connections::systemBus->async_method_call(
                                 [aResp, service{connection.first},
                                  path(std::move(path))](
-                                    const boost::system::error_code ec,
+                                    const boost::system::error_code ec2,
                                     const std::vector<
                                         std::pair<std::string, VariantType>>&
                                         properties) {
-                                    if (ec)
+                                    if (ec2)
                                     {
                                         BMCWEB_LOG_ERROR
-                                            << "DBUS response error " << ec;
+                                            << "DBUS response error " << ec2;
                                         messages::internalError(aResp->res);
                                         return;
                                     }
@@ -368,15 +368,15 @@
                                         auto getCpuPresenceState =
                                             [aResp](
                                                 const boost::system::error_code
-                                                    ec,
+                                                    ec3,
                                                 const std::variant<bool>&
                                                     cpuPresenceCheck) {
-                                                if (ec)
+                                                if (ec3)
                                                 {
                                                     BMCWEB_LOG_ERROR
                                                         << "DBUS response "
                                                            "error "
-                                                        << ec;
+                                                        << ec3;
                                                     return;
                                                 }
                                                 modifyCpuPresenceState(
@@ -386,15 +386,15 @@
                                         auto getCpuFunctionalState =
                                             [aResp](
                                                 const boost::system::error_code
-                                                    ec,
+                                                    ec3,
                                                 const std::variant<bool>&
                                                     cpuFunctionalCheck) {
-                                                if (ec)
+                                                if (ec3)
                                                 {
                                                     BMCWEB_LOG_ERROR
                                                         << "DBUS response "
                                                            "error "
-                                                        << ec;
+                                                        << ec3;
                                                     return;
                                                 }
                                                 modifyCpuFunctionalState(
@@ -445,14 +445,14 @@
                                 << "Found UUID, now get its properties.";
                             crow::connections::systemBus->async_method_call(
                                 [aResp](
-                                    const boost::system::error_code ec,
+                                    const boost::system::error_code ec3,
                                     const std::vector<
                                         std::pair<std::string, VariantType>>&
                                         properties) {
-                                    if (ec)
+                                    if (ec3)
                                     {
                                         BMCWEB_LOG_DEBUG
-                                            << "DBUS response error " << ec;
+                                            << "DBUS response error " << ec3;
                                         messages::internalError(aResp->res);
                                         return;
                                     }
@@ -496,11 +496,11 @@
                         {
                             crow::connections::systemBus->async_method_call(
                                 [aResp](
-                                    const boost::system::error_code ec,
+                                    const boost::system::error_code ec2,
                                     const std::vector<
                                         std::pair<std::string, VariantType>>&
                                         propertiesList) {
-                                    if (ec)
+                                    if (ec2)
                                     {
                                         // doesn't have to include this
                                         // interface
@@ -544,9 +544,9 @@
 
                             crow::connections::systemBus->async_method_call(
                                 [aResp](
-                                    const boost::system::error_code ec,
+                                    const boost::system::error_code ec2,
                                     const std::variant<std::string>& property) {
-                                    if (ec)
+                                    if (ec2)
                                     {
                                         // doesn't have to include this
                                         // interface
@@ -1004,11 +1004,11 @@
                 // If AutomaticRetry (AutoReboot) is enabled see how many
                 // attempts are left
                 crow::connections::systemBus->async_method_call(
-                    [aResp](const boost::system::error_code ec,
+                    [aResp](const boost::system::error_code ec2,
                             std::variant<uint32_t>& autoRebootAttemptsLeft) {
-                        if (ec)
+                        if (ec2)
                         {
-                            BMCWEB_LOG_DEBUG << "D-BUS response error " << ec;
+                            BMCWEB_LOG_DEBUG << "D-BUS response error " << ec2;
                             return;
                         }
 
@@ -1660,8 +1660,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         res.jsonValue["@odata.type"] =
@@ -1671,25 +1671,22 @@
 
         crow::connections::systemBus->async_method_call(
             [asyncResp](const boost::system::error_code ec,
-                        const std::variant<std::string>& hostName) {
+                        const std::variant<std::string>& /*hostName*/) {
                 nlohmann::json& iface_array =
                     asyncResp->res.jsonValue["Members"];
                 iface_array = nlohmann::json::array();
                 auto& count = asyncResp->res.jsonValue["Members@odata.count"];
                 count = 0;
-                if (ec)
+                iface_array.push_back(
+                    {{"@odata.id", "/redfish/v1/Systems/system"}});
+                if (!ec)
                 {
+                    BMCWEB_LOG_DEBUG << "Hypervisor is available";
                     iface_array.push_back(
-                        {{"@odata.id", "/redfish/v1/Systems/system"}});
+                        {{"@odata.id", "/redfish/v1/Systems/hypervisor"}});
                     count = iface_array.size();
                     return;
                 }
-                BMCWEB_LOG_DEBUG << "Hypervisor is available";
-                iface_array.push_back(
-                    {{"@odata.id", "/redfish/v1/Systems/system"}});
-                iface_array.push_back(
-                    {{"@odata.id", "/redfish/v1/Systems/hypervisor"}});
-                count = iface_array.size();
             },
             "xyz.openbmc_project.Settings",
             "/xyz/openbmc_project/network/hypervisor",
@@ -1718,7 +1715,7 @@
      * Analyzes POST body message before sends Reset request data to D-Bus.
      */
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
 
@@ -1883,8 +1880,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue["@odata.type"] = "#ComputerSystem.v1_12_0.ComputerSystem";
         res.jsonValue["Name"] = "system";
@@ -1971,7 +1968,7 @@
     }
 
     void doPatch(crow::Response& res, const crow::Request& req,
-                 const std::vector<std::string>& params) override
+                 const std::vector<std::string>&) override
     {
         std::optional<std::string> indicatorLed;
         std::optional<nlohmann::json> bootProps;
@@ -2065,8 +2062,8 @@
     /**
      * Functions triggers appropriate requests on DBus
      */
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         res.jsonValue = {
             {"@odata.type", "#ActionInfo.v1_1_2.ActionInfo"},
diff --git a/redfish-core/lib/task.hpp b/redfish-core/lib/task.hpp
index d6c479f..f7f0ff9 100644
--- a/redfish-core/lib/task.hpp
+++ b/redfish-core/lib/task.hpp
@@ -258,7 +258,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -314,7 +314,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
@@ -388,8 +388,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         asyncResp->res.jsonValue["@odata.type"] =
@@ -428,8 +428,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         auto asyncResp = std::make_shared<AsyncResp>(res);
         asyncResp->res.jsonValue["@odata.type"] =
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index 84cef2b..8e01bee 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -37,7 +37,7 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         if (params.size() != 1)
diff --git a/redfish-core/lib/update_service.hpp b/redfish-core/lib/update_service.hpp
index c695a9b..a0fd252 100644
--- a/redfish-core/lib/update_service.hpp
+++ b/redfish-core/lib/update_service.hpp
@@ -391,7 +391,7 @@
 
   private:
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         std::optional<std::string> transferProtocol;
         std::string imageURI;
@@ -518,8 +518,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> aResp = std::make_shared<AsyncResp>(res);
         res.jsonValue["@odata.type"] = "#UpdateService.v1_4_0.UpdateService";
@@ -580,7 +580,7 @@
     }
 
     void doPatch(crow::Response& res, const crow::Request& req,
-                 const std::vector<std::string>& params) override
+                 const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "doPatch...";
 
@@ -660,7 +660,7 @@
     }
 
     void doPost(crow::Response& res, const crow::Request& req,
-                const std::vector<std::string>& params) override
+                const std::vector<std::string>&) override
     {
         BMCWEB_LOG_DEBUG << "doPost...";
 
@@ -698,8 +698,8 @@
     }
 
   private:
-    void doGet(crow::Response& res, const crow::Request& req,
-               const std::vector<std::string>& params) override
+    void doGet(crow::Response& res, const crow::Request&,
+               const std::vector<std::string>&) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
         res.jsonValue["@odata.type"] =
@@ -797,7 +797,7 @@
         }
     }
 
-    void doGet(crow::Response& res, const crow::Request& req,
+    void doGet(crow::Response& res, const crow::Request&,
                const std::vector<std::string>& params) override
     {
         std::shared_ptr<AsyncResp> asyncResp = std::make_shared<AsyncResp>(res);
