pldm: Remove unnecessary type casting in logs
This commit removes the unnecessary type casting of values of the
journal logs based on supported types mentioned in LG2 documentation
[1].
Testing: Verified the debug traces to correct.
'''
For Instance:
Earlier -
error(”TYPE = {TYPE} “, “TYPE”, static_cast<unsigned>(PLDM_STATE_EFFECTER_PDR));
Journal trace -
May 27 08:16:51 p10bmc pldmd[931]: TYPE = 11
After Correction -
error(”TYPE = {TYPE}“, “TYPE”, PLDM_STATE_EFFECTER_PDR);
Journal trace -
May 27 08:16:51 p10bmc pldmd[931]: TYPE = Enum(11)
'''
[1]: https://github.com/openbmc/phosphor-logging/blob/master/docs/structured-logging.md#lg2
Change-Id: Ia649ecd4ecbb73c421f7844885f58a6835805719
Signed-off-by: Riya Dixit <riyadixitagra@gmail.com>
diff --git a/oem/ibm/libpldmresponder/file_io.hpp b/oem/ibm/libpldmresponder/file_io.hpp
index e455583..495cf24 100644
--- a/oem/ibm/libpldmresponder/file_io.hpp
+++ b/oem/ibm/libpldmresponder/file_io.hpp
@@ -117,7 +117,7 @@
int file = open(path.string().c_str(), flags);
if (file == -1)
{
- error("File at path '{PATH}' does not exist", "PATH", path.string());
+ error("File at path '{PATH}' does not exist", "PATH", path);
encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
responsePtr);
return response;
diff --git a/oem/ibm/libpldmresponder/file_io_type_pcie.cpp b/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
index 92ceff9..b95361f 100644
--- a/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
+++ b/oem/ibm/libpldmresponder/file_io_type_pcie.cpp
@@ -59,7 +59,7 @@
catch (const std::exception& e)
{
error("Create/Write data to the File type {TYPE}, failed {ERROR}",
- "TYPE", (int)infoType, "ERROR", e);
+ "TYPE", infoType, "ERROR", e);
return PLDM_ERROR;
}
}
@@ -87,7 +87,7 @@
catch (const std::exception& e)
{
error("Create/Write data to the File type {TYPE}, failed {ERROR}",
- "TYPE", (int)infoType, "ERROR", e);
+ "TYPE", infoType, "ERROR", e);
return PLDM_ERROR;
}
diff --git a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
index 906e964..301de47 100644
--- a/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
+++ b/oem/ibm/libpldmresponder/oem_ibm_handler.cpp
@@ -322,7 +322,7 @@
{
error(
"Failed to decode platform event message response for code update event with response code '{RC}' and completion code '{CC}'",
- "RC", rc, "CC", static_cast<unsigned>(completionCode));
+ "RC", rc, "CC", completionCode);
}
};
auto rc = handler->registerRequest(
diff --git a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
index 4ea7b2f..da9e4d3 100644
--- a/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
+++ b/oem/ibm/libpldmresponder/platform_oem_ibm.cpp
@@ -98,7 +98,7 @@
{
error(
"Failed to decode BIOS Attribute update platform event message response with response code '{RC}' and completion code '{CC}'",
- "RC", rc, "CC", static_cast<unsigned>(completionCode));
+ "RC", rc, "CC", completionCode);
}
};
rc = handler->registerRequest(