diff options
author | Anthony <anthonyhkf@google.com> | 2023-05-24 11:27:19 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-05-25 05:29:13 +0300 |
commit | c5091a04dc9f2f62cf633461367ff4cbb958e44f (patch) | |
tree | d155dda19ab571e4eaabaa335cc322de7f53ecb9 /redfish-core/lib | |
parent | a0d6e39ece329d3b7ae6019067b897f5835dfada (diff) | |
download | bmcweb-c5091a04dc9f2f62cf633461367ff4cbb958e44f.tar.xz |
Update DIMM memorySizeInKB to be in size_t
Following the changes in
https://gerrit.openbmc.org/c/openbmc/phosphor-dbus-interfaces/+/41870
where `MemorySizeInKB` type changed from `uint32` to `size`.
Tested:
On a 64-bit system, MemorySizeInKB has type `t`, which is uint64.
```
.MemorySizeInKB property t 33554432 emits-change writable
```
Before:
```
[ERROR "dbus_utils.hpp":21] DBUS property error in property: MemorySizeInKB, reason: 1
---
~# curl localhost/redfish/v1/Systems/system -s \
| grep -A7 MemorySummary
"MemorySummary": {
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Disabled"
},
"TotalSystemMemoryGiB": 0
},
```
After:
```
~# curl localhost/redfish/v1/Systems/system -s \
| grep -A7 MemorySummary
"MemorySummary": {
"Status": {
"Health": "OK",
"HealthRollup": "OK",
"State": "Enabled"
},
"TotalSystemMemoryGiB": 64
},
```
Change-Id: Ifc66d4cf78ea81629957091bc4f3b407aa96355a
Signed-off-by: Anthony <anthonyhkf@google.com>
Diffstat (limited to 'redfish-core/lib')
-rw-r--r-- | redfish-core/lib/systems.hpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/redfish-core/lib/systems.hpp b/redfish-core/lib/systems.hpp index 1cedf2d38d..b05189935f 100644 --- a/redfish-core/lib/systems.hpp +++ b/redfish-core/lib/systems.hpp @@ -339,7 +339,7 @@ inline void return; } - const uint32_t* memorySizeInKB = nullptr; + const size_t* memorySizeInKB = nullptr; const bool success = sdbusplus::unpackPropertiesNoThrow( @@ -366,14 +366,16 @@ inline void aResp->res .jsonValue["MemorySummary"] ["TotalSystemMemoryGiB"] = - *memorySizeInKB / (1024 * 1024); + *memorySizeInKB / + static_cast<size_t>(1024 * 1024); } else { aResp->res .jsonValue["MemorySummary"] ["TotalSystemMemoryGiB"] = - *memorySizeInKB / (1024 * 1024) + + *memorySizeInKB / + static_cast<size_t>(1024 * 1024) + *preValue; } aResp->res.jsonValue["MemorySummary"]["Status"] |