summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2011-05-29 19:53:11 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2011-05-29 19:53:11 +0000
commitc32e78294610dabd3dd2f86896b1c0f6d30a4491 (patch)
treec34577b449a00b45b9b6f4a6c2065efaf3f08862 /sys/powerpc
parentaff5c69fe1a8ec60d886d1b2a7b32baa84ad3422 (diff)
downloadFreeBSD-src-c32e78294610dabd3dd2f86896b1c0f6d30a4491.zip
FreeBSD-src-c32e78294610dabd3dd2f86896b1c0f6d30a4491.tar.gz
Don't put negative values into the averages.
Diffstat (limited to 'sys/powerpc')
-rw-r--r--sys/powerpc/powermac/powermac_thermal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/powerpc/powermac/powermac_thermal.c b/sys/powerpc/powermac/powermac_thermal.c
index 89637ca..041924a 100644
--- a/sys/powerpc/powermac/powermac_thermal.c
+++ b/sys/powerpc/powermac/powermac_thermal.c
@@ -121,6 +121,8 @@ pmac_therm_manage_fans(void)
sensor->sensor->target_temp)*100 /
(sensor->sensor->max_temp -
sensor->sensor->target_temp);
+ if (frac_excess < 0)
+ frac_excess = 0;
if (sensor->sensor->zone == fan->fan->zone) {
max_excess_zone = imax(max_excess_zone,
frac_excess);
OpenPOWER on IntegriCloud