clang-tidy: Enable readability-redundant-string-cstr check
This check finds unnecessary calls to std::string::c_str() and
std::string::data().
Change-Id: I43e747b95eb042650668da7dd57a8d4b8463426a
Signed-off-by: Pavithra Barithaya <pavithrabarithaya07@gmail.com>
diff --git a/discover_system_state.cpp b/discover_system_state.cpp
index 892fb6c..53a414f 100644
--- a/discover_system_state.cpp
+++ b/discover_system_state.cpp
@@ -86,7 +86,7 @@
auto bmcRebootCause =
sdbusplus::message::convert_from_string<BMC::RebootCause>(
phosphor::state::manager::utils::getProperty(
- bus, bmcPath.str.c_str(), BMC_BUSNAME, "LastRebootCause"));
+ bus, bmcPath.str, BMC_BUSNAME, "LastRebootCause"));
if (bmcRebootCause == BMC::RebootCause::PinholeReset)
{
@@ -141,8 +141,8 @@
// to default for next time.
info("One time set, use it and reset to default");
phosphor::state::manager::utils::setProperty(
- bus, settings.powerRestorePolicyOneTime.c_str(),
- powerRestoreIntf, "PowerRestorePolicy",
+ bus, settings.powerRestorePolicyOneTime, powerRestoreIntf,
+ "PowerRestorePolicy",
convertForMessage(RestorePolicy::Policy::None));
}