The compute mapping value is either SENSORS_NO_MAPPING or the same

feature number as the logical mapping. This means that the compute
mapping can be turned into a simple boolean flag. Doing so makes
struct sensors_feature_data smaller, which saves some memory (about
17 kB in my tests.)


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4758 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-09-05 08:17:22 +00:00
1 parent 87efbc06c5
commit 20c98f41b7
5 files changed
+22 -28

No files matched your search

+3 -6
View File
@@ -142,14 +142,11 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
if ((type & 0x00FF) == 0) {
/* main feature */
feature.data.mapping = SENSORS_NO_MAPPING;
feature.data.compute_mapping = SENSORS_NO_MAPPING;
} else if (type & 0x10) {
/* sub feature without compute mapping */
feature.data.mapping = i - i % MAX_SUB_FEATURES;
feature.data.compute_mapping = SENSORS_NO_MAPPING;
} else {
/* sub feature */
feature.data.mapping = i - i % MAX_SUB_FEATURES;
feature.data.compute_mapping = feature.data.mapping;
if (!(type & 0x10))
feature.data.flags |= SENSORS_COMPUTE_MAPPING;
}
if (attr->method & SYSFS_METHOD_SHOW)