summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--redfish-core/lib/pcie.hpp5
-rw-r--r--redfish-core/lib/pcie_slots.hpp2
2 files changed, 5 insertions, 2 deletions
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 40fcd412cb..f5c5303554 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -190,7 +190,10 @@ inline void addPCIeSlotProperties(
res.jsonValue["Slot"]["PCIeType"] = *pcieType;
}
- res.jsonValue["Slot"]["Lanes"] = lanes;
+ if (lanes != 0)
+ {
+ res.jsonValue["Slot"]["Lanes"] = lanes;
+ }
std::optional<pcie_slots::SlotTypes> redfishSlotType =
pcie_util::dbusSlotTypeToRf(slotType);
diff --git a/redfish-core/lib/pcie_slots.hpp b/redfish-core/lib/pcie_slots.hpp
index 62fef3ea95..4412c41ed4 100644
--- a/redfish-core/lib/pcie_slots.hpp
+++ b/redfish-core/lib/pcie_slots.hpp
@@ -83,7 +83,7 @@ inline void
}
}
- if (lanes != nullptr)
+ if (lanes != nullptr && *lanes != 0)
{
slot["Lanes"] = *lanes;
}