summaryrefslogtreecommitdiff
path: root/redfish-core/lib/ethernet.hpp
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2020-07-25 22:02:03 +0300
committerEd Tanous <ed@tanous.net>2020-08-17 23:54:37 +0300
commitcb13a39253848ece442971301ade9c09d98bf08e (patch)
tree62f2a64fbc98d8ee635a0a81f3ef07afa541981d /redfish-core/lib/ethernet.hpp
parent23a21a1cbed23ace4174664950e595df961e9e69 (diff)
downloadbmcweb-cb13a39253848ece442971301ade9c09d98bf08e.tar.xz
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>
Diffstat (limited to 'redfish-core/lib/ethernet.hpp')
-rw-r--r--redfish-core/lib/ethernet.hpp49
1 files changed, 23 insertions, 26 deletions
diff --git a/redfish-core/lib/ethernet.hpp b/redfish-core/lib/ethernet.hpp
index 852b3b72c4..babfd4a412 100644
--- a/redfish-core/lib/ethernet.hpp
+++ b/redfish-core/lib/ethernet.hpp
@@ -731,9 +731,8 @@ inline void deleteIPv4(const std::string& ifaceId, const std::string& ipHash,
*
* @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 @@ class EthernetCollection : public Node
/**
* 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 @@ class EthernetInterface : public Node
}
else
{
- createIPv4(ifaceId, entryIdx, prefixLength, *gateway,
- *address, asyncResp);
+ createIPv4(ifaceId, prefixLength, *gateway, *address,
+ asyncResp);
}
entryIdx++;
}
@@ -1868,7 +1867,7 @@ class EthernetInterface : public Node
/**
* 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 @@ class VlanNetworkInterface : public Node
}
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 @@ class VlanNetworkInterface : public Node
/**
* 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 @@ class VlanNetworkInterface : public Node
[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 @@ class VlanNetworkInterface : public Node
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 @@ class VlanNetworkInterface : public Node
});
}
- 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 @@ class VlanNetworkInterface : public Node
[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 @@ class VlanNetworkInterfaceCollection : public Node
/**
* 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);