From da8ba403e2ebebdfa952f4d1315262f9f275267b Mon Sep 17 00:00:00 2001 From: Nan Zhou Date: Tue, 3 May 2022 23:27:32 +0000 Subject: 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 Change-Id: Ie81d2610c245a08a22c3ea891495f34cc0bdc075 --- redfish-core/lib/memory.hpp | 4 ++-- 1 file 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 aResp, } else if (property.first == "MemorySizeInKB") { - const uint32_t* memorySize = - std::get_if(&property.second); + const size_t* memorySize = + std::get_if(&property.second); if (memorySize == nullptr) { // Important property not in desired type -- cgit v1.2.3