mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-29 12:50:43 +00:00
Make SENSORS_FEATURE_MAX_SUB_FEATURES private (and rename it to
MAX_SUB_FEATURES in the process.) This value could change in the future so it's not safe to make it part of the libsensors API. And it isn't needed either, applications shouldn't need to use this value. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4732 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
ed2b9171ec
commit
b491ba49d4
2 files changed
+6
-14
No files matched your search
@@ -154,10 +154,6 @@ typedef enum sensors_feature_type {
|
||||
SENSORS_FEATURE_VID = 0x300,
|
||||
|
||||
SENSORS_FEATURE_UNKNOWN = INT_MAX,
|
||||
|
||||
/* special the largest number of subfeatures used, iow the
|
||||
highest ## from all the 0x?## above + 1*/
|
||||
SENSORS_FEATURE_MAX_SUB_FEATURES = 22
|
||||
} sensors_feature_type;
|
||||
|
||||
/* This structure is used when you want to get all features of a specific
|
||||
|
||||
+6
-10
@@ -37,9 +37,9 @@
|
||||
char sensors_sysfs_mount[NAME_MAX];
|
||||
|
||||
#define MAX_SENSORS_PER_TYPE 16
|
||||
#define MAX_SUB_FEATURES 22
|
||||
/* Room for all 3 types (in, fan, temp) with all their subfeatures + VID */
|
||||
#define ALL_POSSIBLE_FEATURES (MAX_SENSORS_PER_TYPE * \
|
||||
SENSORS_FEATURE_MAX_SUB_FEATURES * 3 \
|
||||
#define ALL_POSSIBLE_FEATURES (MAX_SENSORS_PER_TYPE * MAX_SUB_FEATURES * 3 \
|
||||
+ MAX_SENSORS_PER_TYPE)
|
||||
|
||||
static
|
||||
@@ -122,12 +122,10 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
|
||||
/* "calculate" a place to store the feature in our sparse,
|
||||
sorted table */
|
||||
if (type == SENSORS_FEATURE_VID) {
|
||||
i = nr + MAX_SENSORS_PER_TYPE *
|
||||
SENSORS_FEATURE_MAX_SUB_FEATURES * 3;
|
||||
i = nr + MAX_SENSORS_PER_TYPE * MAX_SUB_FEATURES * 3;
|
||||
} else {
|
||||
i = (type >> 8) * MAX_SENSORS_PER_TYPE *
|
||||
SENSORS_FEATURE_MAX_SUB_FEATURES +
|
||||
nr * SENSORS_FEATURE_MAX_SUB_FEATURES +
|
||||
MAX_SUB_FEATURES + nr * MAX_SUB_FEATURES +
|
||||
(type & 0xFF);
|
||||
}
|
||||
|
||||
@@ -149,12 +147,10 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
|
||||
feature.data.compute_mapping = SENSORS_NO_MAPPING;
|
||||
} else if (type & 0x10) {
|
||||
/* sub feature without compute mapping */
|
||||
feature.data.mapping = i -
|
||||
i % SENSORS_FEATURE_MAX_SUB_FEATURES + 1;
|
||||
feature.data.mapping = i - i % MAX_SUB_FEATURES + 1;
|
||||
feature.data.compute_mapping = SENSORS_NO_MAPPING;
|
||||
} else {
|
||||
feature.data.mapping = i -
|
||||
i % SENSORS_FEATURE_MAX_SUB_FEATURES + 1;
|
||||
feature.data.mapping = i - i % MAX_SUB_FEATURES + 1;
|
||||
feature.data.compute_mapping = feature.data.mapping;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user