commit | da8ba403e2ebebdfa952f4d1315262f9f275267b | [log] [tgz] |
---|---|---|
author | Nan Zhou <nanzhoumails@gmail.com> | Tue May 03 23:27:32 2022 +0000 |
committer | Ed Tanous <ed@tanous.net> | Thu May 05 21:06:05 2022 +0000 |
tree | 6d2de0b1230f57576bbdf7e4511bba377285ba36 | |
parent | 89f180089bce9cc431d0b1053410f262f157b987 [diff] |
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
diff --git a/redfish-core/lib/memory.hpp b/redfish-core/lib/memory.hpp index 20bbfb2..6e4ab67 100644 --- a/redfish-core/lib/memory.hpp +++ b/redfish-core/lib/memory.hpp
@@ -465,8 +465,8 @@ } 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