summaryrefslogtreecommitdiffstats
path: root/sys/dev/k8temp
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2008-05-11 23:14:07 +0000
committerrpaulo <rpaulo@FreeBSD.org>2008-05-11 23:14:07 +0000
commit5532dee40e5b05f2bf722f43eac11f9696d6fc3a (patch)
treed55fe5f44e08d85f9bf6186bb0d7cf03bff454d2 /sys/dev/k8temp
parentc77c17c6be177bf3c1feabfb54e8bd70f8472bb6 (diff)
downloadFreeBSD-src-5532dee40e5b05f2bf722f43eac11f9696d6fc3a.zip
FreeBSD-src-5532dee40e5b05f2bf722f43eac11f9696d6fc3a.tar.gz
Don't use libkern's max() function as that's for unsigned numbers only.
Instead use the worldwide known MAX() function. This should fix problems with negative values showing up on dev.cpu.%d.temperature. This is slightly different from the fix in the PR. Submitted by: KOIE Hidetaka <hide at koie.org> PR: 123542
Diffstat (limited to 'sys/dev/k8temp')
-rw-r--r--sys/dev/k8temp/k8temp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/k8temp/k8temp.c b/sys/dev/k8temp/k8temp.c
index 405a7ca..4038ed2 100644
--- a/sys/dev/k8temp/k8temp.c
+++ b/sys/dev/k8temp/k8temp.c
@@ -265,12 +265,12 @@ k8temp_sysctl(SYSCTL_HANDLER_ARGS)
case CORE0:
auxtemp[0] = k8temp_gettemp(dev, SENSOR0_CORE0);
auxtemp[1] = k8temp_gettemp(dev, SENSOR1_CORE0);
- temp = max(auxtemp[0], auxtemp[1]);
+ temp = MAX(auxtemp[0], auxtemp[1]);
break;
case CORE1:
auxtemp[0] = k8temp_gettemp(dev, SENSOR0_CORE1);
auxtemp[1] = k8temp_gettemp(dev, SENSOR1_CORE1);
- temp = max(auxtemp[0], auxtemp[1]);
+ temp = MAX(auxtemp[0], auxtemp[1]);
break;
default:
temp = k8temp_gettemp(dev, arg2);
OpenPOWER on IntegriCloud