Enable unused variable warnings and resolve
This commit enables the "unused variables" warning in clang. Throughout
this, it did point out several issues that would've been functional
bugs, so I think it was worthwhile. It also cleaned up several unused
variable from old constructs that no longer exist.
Tested:
Built with clang. Code no longer emits warnings.
Downloaded bmcweb to system and pulled up the webui, observed webui
loads and logs in properly.
Change-Id: I51505f4222cc147d6f2b87b14d7e2ac4a74cafa8
Signed-off-by: Ed Tanous <ed@tanous.net>
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);