diff options
author | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2010-12-14 09:09:42 +0000 |
---|---|---|
committer | khali <khali@7894878c-1315-0410-8ee3-d5d059ff63e0> | 2010-12-14 09:09:42 +0000 |
commit | 5f0b5a19e61dba11dae3998cd330907b6ae371b3 (patch) | |
tree | 9515ce2851dd638080bb4ab343bde19105bf137e | |
parent | 5ae1b7b9f99092fcbc1fb469b7ffddb0e5eb9bb8 (diff) | |
download | lm-sensors-5f0b5a19e61dba11dae3998cd330907b6ae371b3.tar.gz |
Compute MAX_*_SENSOR_TYPES at build time (#2378).
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5897 7894878c-1315-0410-8ee3-d5d059ff63e0
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/sensors.h | 2 | ||||
-rw-r--r-- | lib/sysfs.c | 4 |
3 files changed, 5 insertions, 2 deletions
@@ -5,6 +5,7 @@ SVN HEAD Makefile: Check for bison and flex libsensors: Add support for intrusion detection (#2370) Compute MAX_SUBFEATURES at run-time (#2378) + Compute MAX_*_SENSOR_TYPES at build time (#2378) sensors.conf.defauit: Add a section for the W83627THF Add a section for the SCH5127 sensors: Display 3 decimal places in raw output diff --git a/lib/sensors.h b/lib/sensors.h index 1ff71468..c75286b7 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -140,8 +140,10 @@ typedef enum sensors_feature_type { SENSORS_FEATURE_POWER = 0x03, SENSORS_FEATURE_ENERGY = 0x04, SENSORS_FEATURE_CURR = 0x05, + SENSORS_FEATURE_MAX_MAIN, SENSORS_FEATURE_VID = 0x10, SENSORS_FEATURE_INTRUSION = 0x11, + SENSORS_FEATURE_MAX_OTHER, SENSORS_FEATURE_BEEP_ENABLE = 0x18, SENSORS_FEATURE_UNKNOWN = INT_MAX, } sensors_feature_type; diff --git a/lib/sysfs.c b/lib/sysfs.c index 3ad0e838..a0d619a6 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -136,8 +136,8 @@ static int sysfs_foreach_busdev(const char *bus_type, char sensors_sysfs_mount[NAME_MAX]; -#define MAX_MAIN_SENSOR_TYPES 6 -#define MAX_OTHER_SENSOR_TYPES 2 +#define MAX_MAIN_SENSOR_TYPES (SENSORS_FEATURE_MAX_MAIN - SENSORS_FEATURE_IN) +#define MAX_OTHER_SENSOR_TYPES (SENSORS_FEATURE_MAX_OTHER - SENSORS_FEATURE_VID) #define MAX_SENSORS_PER_TYPE 24 /* max_subfeatures is now computed dynamically */ #define FEATURE_SIZE (max_subfeatures * 2) |