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/softoff/softoff.cpp b/softoff/softoff.cpp
index c522635..d3c2284 100644
--- a/softoff/softoff.cpp
+++ b/softoff/softoff.cpp
@@ -70,7 +70,7 @@
if (rc != PLDM_SUCCESS)
{
error("Failed to get Sensor PDRs, response code '{RC}'", "RC",
- lg2::hex, static_cast<int>(rc));
+ lg2::hex, rc);
hasError = true;
return;
}
@@ -296,7 +296,7 @@
instanceIdDb.free(pldmTID, instanceID);
error(
"Failed to encode set state effecter states request message, response code '{RC}'",
- "RC", lg2::hex, static_cast<int>(rc));
+ "RC", lg2::hex, rc);
return PLDM_ERROR;
}
@@ -337,7 +337,7 @@
{
error(
"Failed to receive pldm data during soft-off, response code '{RC}'",
- "RC", static_cast<int>(rc));
+ "RC", rc);
return;
}
@@ -363,7 +363,7 @@
if (response->payload[0] != PLDM_SUCCESS)
{
error("Getting the wrong response, response code '{RC}'", "RC",
- (unsigned)response->payload[0]);
+ response->payload[0]);
exit(-1);
}
@@ -399,7 +399,7 @@
instanceIdDb.free(pldmTID, instanceID);
error(
"Failed to send message/receive response, response code '{RC}' and error - {ERROR}",
- "RC", static_cast<int>(rc), "ERROR", errno);
+ "RC", rc, "ERROR", errno);
return PLDM_ERROR;
}