IntelCPUSensor: Fix PropertiesChanged callback setup
Commit 214d9717c01a ("Refactor PropertiesChanged handler setup") broke
IntelCPUSensor, because that commit assumed that the sensorTypes array
included the "xyz.openbmc_project.Configuration." prefix (as is the case
in all the other daemons). Bring IntelCPUSensor into consistency with
its peers by adding the prefix to sensorTypes (every place that used it
was manually adding the prefix at runtime anyway).
Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I4ada9b9ac94d95de8d0a3dd98ec2621049688f1f
diff --git a/src/IntelCPUSensorMain.cpp b/src/IntelCPUSensorMain.cpp
index 287be9f..b2238a6 100644
--- a/src/IntelCPUSensorMain.cpp
+++ b/src/IntelCPUSensorMain.cpp
@@ -90,9 +90,8 @@
namespace fs = std::filesystem;
-static constexpr const char* configPrefix =
- "xyz.openbmc_project.Configuration.";
-static constexpr auto sensorTypes{std::to_array<const char*>({"XeonCPU"})};
+static constexpr auto sensorTypes{
+ std::to_array<const char*>({"xyz.openbmc_project.Configuration.XeonCPU"})};
static constexpr auto hiddenProps{std::to_array<const char*>(
{IntelCPUSensor::labelTcontrol, "Tthrottle", "Tjmax"})};
@@ -245,7 +244,7 @@
sensorData = &cfgData;
for (const char* type : sensorTypes)
{
- sensorType = configPrefix + std::string(type);
+ sensorType = type;
auto sensorBase = sensorData->find(sensorType);
if (sensorBase != sensorData->end())
{
@@ -610,8 +609,7 @@
// use new data the first time, then refresh
for (const char* type : sensorTypes)
{
- if (!getSensorConfiguration(configPrefix + std::string(type), systemBus,
- sensorConfigs, useCache))
+ if (!getSensorConfiguration(type, systemBus, sensorConfigs, useCache))
{
return false;
}
@@ -626,7 +624,7 @@
{
for (const auto& [intf, cfg] : cfgData)
{
- if ((configPrefix + std::string(type)) != intf)
+ if (intf != type)
{
continue;
}