summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <edtanous@google.com>2023-02-10 22:57:54 +0300
committerEd Tanous <ed@tanous.net>2023-02-16 20:08:24 +0300
commit4ce2c1b55617262e497164ebed001509d5ce8a60 (patch)
treede9cdcc47c4a28db3a18f2e1b90ac29a09c641ff
parentd093c9961eeb6bdfcfa280b6a2bbbbef00e3fe59 (diff)
downloadbmcweb-4ce2c1b55617262e497164ebed001509d5ce8a60.tar.xz
Make pcie_slots compile
This code doesn't compile; Including it in redfish.hpp, even if it's not used, ensures that we keep code compiling. Tested: Code compiles. No functional impact. Signed-off-by: Ed Tanous <edtanous@google.com> Change-Id: Ia1009416a692b9700998d6329a297a6754076cf0
-rw-r--r--redfish-core/include/redfish.hpp1
-rw-r--r--redfish-core/lib/pcie_slots.hpp36
2 files changed, 19 insertions, 18 deletions
diff --git a/redfish-core/include/redfish.hpp b/redfish-core/include/redfish.hpp
index cf385100bf..e1d07a2b0b 100644
--- a/redfish-core/include/redfish.hpp
+++ b/redfish-core/include/redfish.hpp
@@ -34,6 +34,7 @@
#include "metric_report_definition.hpp"
#include "network_protocol.hpp"
#include "pcie.hpp"
+#include "pcie_slots.hpp"
#include "power.hpp"
#include "power_subsystem.hpp"
#include "processor.hpp"
diff --git a/redfish-core/lib/pcie_slots.hpp b/redfish-core/lib/pcie_slots.hpp
index 1c4b6e9933..70efa13211 100644
--- a/redfish-core/lib/pcie_slots.hpp
+++ b/redfish-core/lib/pcie_slots.hpp
@@ -3,7 +3,7 @@
#include "app.hpp"
#include "dbus_utility.hpp"
#include "error_messages.hpp"
-#include "generated/enums/pcie_slot.hpp"
+#include "generated/enums/pcie_slots.hpp"
#include "pcie.hpp"
#include "registries/privilege_registry.hpp"
#include "utility.hpp"
@@ -20,53 +20,53 @@
namespace redfish
{
-inline pcie_slot::SlotTypes dbusSlotTypeToRf(const std::string& slotType)
+inline pcie_slots::SlotTypes dbusSlotTypeToRf(const std::string& slotType)
{
if (slotType ==
"xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.FullLength")
{
- return pcie_slot::SlotTypes::FullLength;
+ return pcie_slots::SlotTypes::FullLength;
}
if (slotType ==
"xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.HalfLength")
{
- return pcie_slot::SlotTypes::HalfLength;
+ return pcie_slots::SlotTypes::HalfLength;
}
if (slotType ==
"xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.LowProfile")
{
- return pcie_slot::SlotTypes::LowProfile;
+ return pcie_slots::SlotTypes::LowProfile;
}
if (slotType ==
"xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.Mini")
{
- return pcie_slot::SlotTypes::Mini;
+ return pcie_slots::SlotTypes::Mini;
}
if (slotType == "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.M_2")
{
- return pcie_slot::SlotTypes::M2;
+ return pcie_slots::SlotTypes::M2;
}
if (slotType == "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.OEM")
{
- return pcie_slot::SlotTypes::OEM;
+ return pcie_slots::SlotTypes::OEM;
}
if (slotType ==
"xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.OCP3Small")
{
- return pcie_slot::SlotTypes::OCP3Small;
+ return pcie_slots::SlotTypes::OCP3Small;
}
if (slotType ==
"xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.OCP3Large")
{
- return pcie_slot::SlotTypes::OCP3Large;
+ return pcie_slots::SlotTypes::OCP3Large;
}
if (slotType == "xyz.openbmc_project.Inventory.Item.PCIeSlot.SlotTypes.U_2")
{
- return pcie_slot::SlotTypes::U2;
+ return pcie_slots::SlotTypes::U2;
}
// Unknown or others
- return pcie_slot::SlotTypes::Invalid;
+ return pcie_slots::SlotTypes::Invalid;
}
inline void
@@ -130,8 +130,8 @@ inline void
if (slotType != nullptr)
{
- std::string redfishSlotType = dbusSlotTypeToRf(*slotType);
- if (!slotType.empty())
+ pcie_slots::SlotTypes redfishSlotType = dbusSlotTypeToRf(*slotType);
+ if (redfishSlotType == pcie_slots::SlotTypes::Invalid)
{
messages::internalError(asyncResp->res);
return;
@@ -193,9 +193,9 @@ inline void onMapperAssociationDone(
sdbusplus::asio::getAllProperties(
*crow::connections::systemBus, connectionName, pcieSlotPath,
"xyz.openbmc_project.Inventory.Item.PCIeSlot",
- [asyncResp](const boost::system::error_code ec,
+ [asyncResp](const boost::system::error_code ec2,
const dbus::utility::DBusPropertiesMap& propertiesList) {
- onPcieSlotGetAllDone(asyncResp, ec, propertiesList);
+ onPcieSlotGetAllDone(asyncResp, ec2, propertiesList);
});
}
@@ -241,10 +241,10 @@ inline void
// it belongs to this ChassisID
crow::connections::systemBus->async_method_call(
[asyncResp, chassisID, pcieSlotPath, connectionName](
- const boost::system::error_code ec,
+ const boost::system::error_code& ec2,
const std::variant<std::vector<std::string>>& endpoints) {
onMapperAssociationDone(asyncResp, chassisID, pcieSlotPath,
- connectionName, ec, endpoints);
+ connectionName, ec2, endpoints);
},
"xyz.openbmc_project.ObjectMapper",
std::string{pcieSlotAssociationPath},