add hysteresis param to parseThresholdsFromAttr()
Parameter 'hysteresis' with a default = NaN, is added to the header for
parseThresholdsFromAttr(), and existing calls to it now explicitly
specify a hysteresis value.
This is an alternative to having calls to parseThresholdFromAttr() use
a hardcoded Intel-specific value of '0.'
The 'NaN' value was chosen as default because it reflects the value
that was being written before a device-specific value was hardcoded in
to solve a specific issue.
Change was created based on the discussion here:
https://gerrit.openbmc.org/c/openbmc/dbus-sensors/+/61744/comments/38f6a
221_58a39817a
Tested: Confirmed the code builds and doesn't throw errors with OBMC
'local CI' testing. I believe heavier testing with actual Intel HW
isn't needed because this change simple moves where a value is specified
(from hardcode in function body to passed-in parameter) without
affecting any existing in-use functionality.
Change-Id: I1240b951d6e37adc1aad5ad3b19144f6baa64998
Signed-off-by: Chris Sides <christopher.sides@hpe.com>
diff --git a/src/IntelCPUSensorMain.cpp b/src/IntelCPUSensorMain.cpp
index 005ed7e..b9ee586 100644
--- a/src/IntelCPUSensorMain.cpp
+++ b/src/IntelCPUSensorMain.cpp
@@ -362,7 +362,7 @@
{
if (!parseThresholdsFromAttr(sensorThresholds, inputPathStr,
IntelCPUSensor::sensorScaleFactor,
- dtsOffset))
+ dtsOffset, 0))
{
std::cerr << "error populating thresholds for "
<< sensorName << "\n";