summaryrefslogtreecommitdiff
path: root/redfish-core/lib/memory.hpp
diff options
context:
space:
mode:
authorNan Zhou <nanzhoumails@gmail.com>2022-05-04 02:27:32 +0300
committerEd Tanous <ed@tanous.net>2022-05-06 00:06:05 +0300
commitda8ba403e2ebebdfa952f4d1315262f9f275267b (patch)
tree6d2de0b1230f57576bbdf7e4511bba377285ba36 /redfish-core/lib/memory.hpp
parent89f180089bce9cc431d0b1053410f262f157b987 (diff)
downloadbmcweb-da8ba403e2ebebdfa952f4d1315262f9f275267b.tar.xz
memory: correct type of MemorySizeInKB
This is needed for this code to work on both 32 and 64 bits system. According to the interface, https://github.com/openbmc/phosphor-dbus-interfaces/blob/388b58f9a878f45b8ec243152cac5eb44ec90ced/yaml/xyz/openbmc_project/Inventory/Item/Dimm.interface.yaml#L9, MemorySizeInKB is of type size_t. Tested: On real hardware, the memory resource is working as expected. Signed-off-by: Nan Zhou <nanzhoumails@gmail.com> Change-Id: Ie81d2610c245a08a22c3ea891495f34cc0bdc075
Diffstat (limited to 'redfish-core/lib/memory.hpp')
-rw-r--r--redfish-core/lib/memory.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp
index 20bbfb283c..6e4ab679c0 100644
--- a/redfish-core/lib/memory.hpp
+++ b/redfish-core/lib/memory.hpp
@@ -465,8 +465,8 @@ inline void getDimmDataByService(std::shared_ptr<bmcweb::AsyncResp> aResp,
}
else if (property.first == "MemorySizeInKB")
{
- const uint32_t* memorySize =
- std::get_if<uint32_t>(&property.second);
+ const size_t* memorySize =
+ std::get_if<size_t>(&property.second);
if (memorySize == nullptr)
{
// Important property not in desired type