diff options
author | njl <njl@FreeBSD.org> | 2005-02-24 20:20:11 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2005-02-24 20:20:11 +0000 |
commit | dde81671fd0537a5b7e1d9c439a99c06021efcec (patch) | |
tree | 06bde2a05106df2ce072e2a6c124365cf2f12d57 | |
parent | 95b8a2e63a833c832237a8c268ae0619377a1cd9 (diff) | |
download | FreeBSD-src-dde81671fd0537a5b7e1d9c439a99c06021efcec.zip FreeBSD-src-dde81671fd0537a5b7e1d9c439a99c06021efcec.tar.gz |
Correct an off-by-one error in the number of settings est announces.
The extraneous "0" state was not fatal but useless.
-rw-r--r-- | sys/i386/cpufreq/est.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/i386/cpufreq/est.c b/sys/i386/cpufreq/est.c index d40fa4a..53b1cd7 100644 --- a/sys/i386/cpufreq/est.c +++ b/sys/i386/cpufreq/est.c @@ -717,15 +717,14 @@ est_settings(device_t dev, struct cf_setting *sets, int *count) return (E2BIG); i = 0; - for (f = sc->freq_list; f->freq != 0; f++) { + for (f = sc->freq_list; f->freq != 0; f++, i++) { sets[i].freq = f->freq; sets[i].volts = f->volts; sets[i].power = CPUFREQ_VAL_UNKNOWN; sets[i].lat = EST_TRANS_LAT; sets[i].dev = dev; - i++; } - *count = i + 1; + *count = i; return (0); } @@ -751,7 +750,7 @@ est_set(device_t dev, const struct cf_setting *set) msr = (msr & ~0xffff) | f->id16; wrmsr(MSR_PERF_CTL, msr); - /* Wait a short while for the new setting. Is this necessary? */ + /* Wait a short while for the new setting. XXX Is this necessary? */ DELAY(EST_TRANS_LAT); return (0); |