2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-29 13:28:01 +00:00

Start numbering the features at 0, not 1. There's nothing wrong with

having a feature number 0, and this makes the code slightly simpler.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4744 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare 2007-09-02 11:15:27 +00:00
parent 75859ca9dc
commit 2a822a2d96

View File

@ -136,7 +136,7 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip,
}
/* fill in the other feature members */
feature.data.number = i + 1;
feature.data.number = i;
feature.data.type = type;
if ((type & 0x00FF) == 0) {
@ -145,10 +145,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 % MAX_SUB_FEATURES + 1;
feature.data.mapping = i - i % MAX_SUB_FEATURES;
feature.data.compute_mapping = SENSORS_NO_MAPPING;
} else {
feature.data.mapping = i - i % MAX_SUB_FEATURES + 1;
feature.data.mapping = i - i % MAX_SUB_FEATURES;
feature.data.compute_mapping = feature.data.mapping;
}