]>
Commit | Line | Data |
---|---|---|
4bcae709 JR |
1 | commit d5a3c020d33cc33ee8049f54c7b4dffcd123bf83 |
2 | Author: Pavel Rochnyack <pavel2000@ngs.ru> | |
3 | Date: Mon Dec 3 18:34:14 2018 +0700 | |
4 | ||
5 | sensors: Removed checks for upper limit of SENSORS_API_VERSION | |
6 | ||
7 | That makes no more sense after lm-sensors got new maintainers. | |
8 | ||
9 | Closes: #3006 | |
10 | ||
11 | diff --git a/src/sensors.c b/src/sensors.c | |
12 | index f4ecda5e..33982e06 100644 | |
13 | --- a/src/sensors.c | |
14 | +++ b/src/sensors.c | |
15 | @@ -149,7 +149,7 @@ typedef struct featurelist { | |
16 | static char *conffile = SENSORS_CONF_PATH; | |
17 | /* #endif SENSORS_API_VERSION < 0x400 */ | |
18 | ||
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 { | |
25 | ||
26 | static char *conffile = NULL; | |
27 | static _Bool use_labels = 0; | |
28 | -/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */ | |
29 | - | |
30 | -#else /* if SENSORS_API_VERSION >= 0x500 */ | |
31 | -#error "This version of libsensors is not supported yet. Please report this " \ | |
32 | - "as bug." | |
33 | #endif | |
34 | ||
35 | static featurelist_t *first_feature = NULL; | |
36 | @@ -223,7 +218,7 @@ static int sensors_config(const char *key, const char *value) { | |
37 | if (IS_TRUE(value)) | |
38 | ignorelist_set_invert(sensor_list, 0); | |
39 | } | |
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; | |
44 | } | |
45 | @@ -353,7 +348,7 @@ static int sensors_load_conf(void) { | |
46 | } /* while sensors_get_detected_chips */ | |
47 | /* #endif SENSORS_API_VERSION < 0x400 */ | |
48 | ||
49 | -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) | |
50 | +#elif (SENSORS_API_VERSION >= 0x400) | |
51 | chip_num = 0; | |
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) */ | |
57 | } /* while (chip) */ | |
58 | -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */ | |
59 | +#endif /* (SENSORS_API_VERSION >= 0x400) */ | |
60 | ||
61 | if (first_feature == NULL) { | |
62 | sensors_cleanup(); | |
63 | @@ -485,7 +480,7 @@ static int sensors_read(void) { | |
64 | } /* for fl = first_feature .. NULL */ | |
65 | /* #endif SENSORS_API_VERSION < 0x400 */ | |
66 | ||
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) { | |
70 | double value; | |
71 | int status; | |
72 | @@ -528,7 +523,7 @@ static int sensors_read(void) { | |
73 | ||
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) */ | |
78 | ||
79 | return 0; | |
80 | } /* int sensors_read */ |