From 2a822a2d9607e5a210e0199f2d9226bcc063949c Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 2 Sep 2007 11:15:27 +0000 Subject: [PATCH] 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 --- lib/sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sysfs.c b/lib/sysfs.c index ee854955..e84e11ba 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -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; }