ipmi plugin: Threshold event handler registration fix
authorMariusz Szafranski <mariuszx.szafranski@intel.com>
Thu, 1 Mar 2018 12:09:19 +0000 (12:09 +0000)
committerMariusz Szafranski <mariuszx.szafranski@intel.com>
Thu, 1 Mar 2018 12:09:19 +0000 (12:09 +0000)
This patch fixes registration of threshold event handler for
specific sensor types (e.g. 'System Airflow')

Change-Id: I437f3fe68fecf264adb32a4e2ef4ac214a7e87a4
Signed-off-by: Mariusz Szafranski <mariuszx.szafranski@intel.com>
src/ipmi.c

index f64e617..a880586 100644 (file)
@@ -794,11 +794,9 @@ entity_sensor_update_handler(enum ipmi_update_e op,
 
     if (st->sel_enabled) {
       int status = 0;
-      /* register threshold event if threshold sensor support events */
-      if ((ipmi_sensor_get_event_reading_type(sensor) ==
-           IPMI_EVENT_READING_TYPE_THRESHOLD) &&
-          (ipmi_sensor_get_threshold_access(sensor) !=
-           IPMI_THRESHOLD_ACCESS_SUPPORT_NONE))
+      /* register threshold event handler */
+      if (ipmi_sensor_get_event_reading_type(sensor) ==
+          IPMI_EVENT_READING_TYPE_THRESHOLD)
         status = ipmi_sensor_add_threshold_event_handler(
             sensor, sensor_threshold_event_handler, st);
       /* register discrete handler if discrete/specific sensor support events */