Changeset 4759 for lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c
- Timestamp:
- 09/05/07 10:19:09 (6 years ago)
- Files:
-
- 1 modified
-
lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/branches/lm-sensors-3.0.0/lib/sysfs.c
r4758 r4759 176 176 dyn_features[fnum] = features[i]; 177 177 fnum++; 178 } 179 } 180 181 /* Renumber the features linearly, so that feature number N is at 182 position N in the array. This allows for O(1) look-ups. */ 183 for (i = 0; i < fnum; i++) { 184 int j, old; 185 186 old = dyn_features[i].data.number; 187 dyn_features[i].data.number = i; 188 for (j = i + 1; 189 j < fnum && dyn_features[j].data.mapping != SENSORS_NO_MAPPING; 190 j++) { 191 if (dyn_features[j].data.mapping == old) 192 dyn_features[j].data.mapping = i; 178 193 } 179 194 }
