All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vadim Kochan <vadim4j@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] package/collectd: Fix build issue with SENSORS_API_VERSION >= 0x500
Date: Tue,  1 Jan 2019 11:59:54 +0200	[thread overview]
Message-ID: <20190101095954.8313-1-vadim4j@gmail.com> (raw)

Current collectd version 5.7.1 fails to compile because there is
check which breaks the compilation if lm_sensors API >= 0x500, but
in the mainline codebase this check was removed in commit:

	https://github.com/collectd/collectd/commit/069796bd76dd1ab0089a64f7c9c2a3c9f1475414

So add backported patch based on this commit.

Fixes:

	http://autobuild.buildroot.net/results/c3c84ca6e11b268ba5ada7e3dca18bca681ee43d/

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
---
 ...oved-checks-for-upper-limit-of-SENSORS_AP.patch | 89 ++++++++++++++++++++++
 1 file changed, 89 insertions(+)
 create mode 100644 package/collectd/0003-sensors-Removed-checks-for-upper-limit-of-SENSORS_AP.patch

diff --git a/package/collectd/0003-sensors-Removed-checks-for-upper-limit-of-SENSORS_AP.patch b/package/collectd/0003-sensors-Removed-checks-for-upper-limit-of-SENSORS_AP.patch
new file mode 100644
index 0000000000..9270021dd6
--- /dev/null
+++ b/package/collectd/0003-sensors-Removed-checks-for-upper-limit-of-SENSORS_AP.patch
@@ -0,0 +1,89 @@
+From 069796bd76dd1ab0089a64f7c9c2a3c9f1475414 Mon Sep 17 00:00:00 2001
+From: Pavel Rochnyack <pavel2000@ngs.ru>
+Date: Mon, 3 Dec 2018 18:34:14 +0700
+Subject: [PATCH] sensors: Removed checks for upper limit of
+ SENSORS_API_VERSION
+
+That makes no more sense after lm-sensors got new maintainers.
+
+Issue: #3006
+
+[Vadim Kochan: backported to support 5.7.1 version]
+Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
+---
+ src/sensors.c | 17 ++++++-----------
+ 1 file changed, 6 insertions(+), 11 deletions(-)
+
+diff --git a/src/sensors.c b/src/sensors.c
+index 8f1824d..409dc38 100644
+--- a/src/sensors.c
++++ b/src/sensors.c
+@@ -149,7 +149,7 @@ typedef struct featurelist {
+ static char *conffile = SENSORS_CONF_PATH;
+ /* #endif SENSORS_API_VERSION < 0x400 */
+ 
+-#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
++#elif (SENSORS_API_VERSION >= 0x400)
+ typedef struct featurelist {
+   const sensors_chip_name *chip;
+   const sensors_feature *feature;
+@@ -159,11 +159,6 @@ typedef struct featurelist {
+ 
+ static char *conffile = NULL;
+ static _Bool use_labels = 0;
+-/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
+-
+-#else /* if SENSORS_API_VERSION >= 0x500 */
+-#error "This version of libsensors is not supported yet. Please report this " \
+-	"as bug."
+ #endif
+ 
+ static featurelist_t *first_feature = NULL;
+@@ -223,7 +218,7 @@ static int sensors_config(const char *key, const char *value) {
+     if (IS_TRUE(value))
+       ignorelist_set_invert(sensor_list, 0);
+   }
+-#if (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
++#if (SENSORS_API_VERSION >= 0x400)
+   else if (strcasecmp(key, "UseLabels") == 0) {
+     use_labels = IS_TRUE(value) ? 1 : 0;
+   }
+@@ -353,7 +348,7 @@ static int sensors_load_conf(void) {
+   }   /* while sensors_get_detected_chips */
+ /* #endif SENSORS_API_VERSION < 0x400 */
+ 
+-#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
++#elif (SENSORS_API_VERSION >= 0x400)
+   chip_num = 0;
+   while ((chip = sensors_get_detected_chips(NULL, &chip_num)) != NULL) {
+     const sensors_feature *feature;
+@@ -404,7 +399,7 @@ static int sensors_load_conf(void) {
+       } /* while (subfeature) */
+     }   /* while (feature) */
+   }     /* while (chip) */
+-#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
++#endif /* (SENSORS_API_VERSION >= 0x400) */
+ 
+   if (first_feature == NULL) {
+     sensors_cleanup();
+@@ -479,7 +474,7 @@ static int sensors_read(void) {
+   } /* for fl = first_feature .. NULL */
+ /* #endif SENSORS_API_VERSION < 0x400 */
+ 
+-#elif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500)
++#elif (SENSORS_API_VERSION >= 0x400)
+   for (featurelist_t *fl = first_feature; fl != NULL; fl = fl->next) {
+     double value;
+     int status;
+@@ -518,7 +513,7 @@ static int sensors_read(void) {
+ 
+     sensors_submit(plugin_instance, type, type_instance, value);
+   } /* for fl = first_feature .. NULL */
+-#endif /* (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
++#endif /* (SENSORS_API_VERSION >= 0x400) */
+ 
+   return (0);
+ } /* int sensors_read */
+-- 
+2.14.1
+
-- 
2.14.1

             reply	other threads:[~2019-01-01  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  9:59 Vadim Kochan [this message]
2019-01-01 10:14 ` [Buildroot] [PATCH 1/1] package/collectd: Fix build issue with SENSORS_API_VERSION >= 0x500 Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190101095954.8313-1-vadim4j@gmail.com \
    --to=vadim4j@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.