You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
2.9 KiB

  1. From d5a3c020d33cc33ee8049f54c7b4dffcd123bf83 Mon Sep 17 00:00:00 2001
  2. From: Pavel Rochnyack <pavel2000@ngs.ru>
  3. Date: Mon, 3 Dec 2018 18:34:14 +0700
  4. Subject: [PATCH] sensors: Removed checks for upper limit of
  5. SENSORS_API_VERSION
  6. That makes no more sense after lm-sensors got new maintainers.
  7. Closes: #3006
  8. ---
  9. src/sensors.c | 17 ++++++-----------
  10. 1 file changed, 6 insertions(+), 11 deletions(-)
  11. diff --git a/src/sensors.c b/src/sensors.c
  12. index f4ecda5e49..33982e061a 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. -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
  19. +#elif (SENSORS_API_VERSION >= 0x400)
  20. typedef struct featurelist {
  21. const sensors_chip_name *chip;
  22. const sensors_feature *feature;
  23. @@ -159,11 +159,6 @@ typedef struct featurelist {
  24. static char *conffile = NULL;
  25. static _Bool use_labels = 0;
  26. -/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
  27. -
  28. -#else /* if SENSORS_API_VERSION >= 0x500 */
  29. -#error "This version of libsensors is not supported yet. Please report this " \
  30. - "as bug."
  31. #endif
  32. static featurelist_t *first_feature = NULL;
  33. @@ -223,7 +218,7 @@ static int sensors_config(const char *key, const char *value) {
  34. if (IS_TRUE(value))
  35. ignorelist_set_invert(sensor_list, 0);
  36. }
  37. -#if (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
  38. +#if (SENSORS_API_VERSION >= 0x400)
  39. else if (strcasecmp(key, "UseLabels") == 0) {
  40. use_labels = IS_TRUE(value) ? 1 : 0;
  41. }
  42. @@ -353,7 +348,7 @@ static int sensors_load_conf(void) {
  43. } /* while sensors_get_detected_chips */
  44. /* #endif SENSORS_API_VERSION < 0x400 */
  45. -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
  46. +#elif (SENSORS_API_VERSION >= 0x400)
  47. chip_num = 0;
  48. while ((chip = sensors_get_detected_chips(NULL, &chip_num)) != NULL) {
  49. const sensors_feature *feature;
  50. @@ -410,7 +405,7 @@ static int sensors_load_conf(void) {
  51. } /* while (subfeature) */
  52. } /* while (feature) */
  53. } /* while (chip) */
  54. -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
  55. +#endif /* (SENSORS_API_VERSION >= 0x400) */
  56. if (first_feature == NULL) {
  57. sensors_cleanup();
  58. @@ -485,7 +480,7 @@ static int sensors_read(void) {
  59. } /* for fl = first_feature .. NULL */
  60. /* #endif SENSORS_API_VERSION < 0x400 */
  61. -#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
  62. +#elif (SENSORS_API_VERSION >= 0x400)
  63. for (featurelist_t *fl = first_feature; fl != NULL; fl = fl->next) {
  64. double value;
  65. int status;
  66. @@ -528,7 +523,7 @@ static int sensors_read(void) {
  67. sensors_submit(plugin_instance, type, type_instance, value);
  68. } /* for fl = first_feature .. NULL */
  69. -#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
  70. +#endif /* (SENSORS_API_VERSION >= 0x400) */
  71. return 0;
  72. } /* int sensors_read */