1 commit d5a3c020d33cc33ee8049f54c7b4dffcd123bf83
2 Author: Pavel Rochnyack <pavel2000@ngs.ru>
3 Date: Mon Dec 3 18:34:14 2018 +0700
5 sensors: Removed checks for upper limit of SENSORS_API_VERSION
7 That makes no more sense after lm-sensors got new maintainers.
11 diff --git a/src/sensors.c b/src/sensors.c
12 index f4ecda5e..33982e06 100644
15 @@ -149,7 +149,7 @@ typedef struct featurelist {
16 static char *conffile = SENSORS_CONF_PATH;
17 /* #endif SENSORS_API_VERSION < 0x400 */
19 -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
20 +#elif (SENSORS_API_VERSION >= 0x400)
21 typedef struct featurelist {
22 const sensors_chip_name *chip;
23 const sensors_feature *feature;
24 @@ -159,11 +159,6 @@ typedef struct featurelist {
26 static char *conffile = NULL;
27 static _Bool use_labels = 0;
28 -/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
30 -#else /* if SENSORS_API_VERSION >= 0x500 */
31 -#error "This version of libsensors is not supported yet. Please report this " \
35 static featurelist_t *first_feature = NULL;
36 @@ -223,7 +218,7 @@ static int sensors_config(const char *key, const char *value) {
38 ignorelist_set_invert(sensor_list, 0);
40 -#if (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
41 +#if (SENSORS_API_VERSION >= 0x400)
42 else if (strcasecmp(key, "UseLabels") == 0) {
43 use_labels = IS_TRUE(value) ? 1 : 0;
45 @@ -353,7 +348,7 @@ static int sensors_load_conf(void) {
46 } /* while sensors_get_detected_chips */
47 /* #endif SENSORS_API_VERSION < 0x400 */
49 -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
50 +#elif (SENSORS_API_VERSION >= 0x400)
52 while ((chip = sensors_get_detected_chips(NULL, &chip_num)) != NULL) {
53 const sensors_feature *feature;
54 @@ -410,7 +405,7 @@ static int sensors_load_conf(void) {
55 } /* while (subfeature) */
56 } /* while (feature) */
58 -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
59 +#endif /* (SENSORS_API_VERSION >= 0x400) */
61 if (first_feature == NULL) {
63 @@ -485,7 +480,7 @@ static int sensors_read(void) {
64 } /* for fl = first_feature .. NULL */
65 /* #endif SENSORS_API_VERSION < 0x400 */
67 -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
68 +#elif (SENSORS_API_VERSION >= 0x400)
69 for (featurelist_t *fl = first_feature; fl != NULL; fl = fl->next) {
72 @@ -528,7 +523,7 @@ static int sensors_read(void) {
74 sensors_submit(plugin_instance, type, type_instance, value);
75 } /* for fl = first_feature .. NULL */
76 -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
77 +#endif /* (SENSORS_API_VERSION >= 0x400) */
80 } /* int sensors_read */