summaryrefslogtreecommitdiff
path: root/sys/dev/onewire
diff options
context:
space:
mode:
authorTodd T. Fries <todd@cvs.openbsd.org>2007-11-28 18:26:12 +0000
committerTodd T. Fries <todd@cvs.openbsd.org>2007-11-28 18:26:12 +0000
commitfae1edc6debdff53d2154f1834071980ae3f5e76 (patch)
tree793673d44be6421657f55e071823ce497efbebb7 /sys/dev/onewire
parentdd78246c073cab81c4852fe29696bf413d57169b (diff)
my brother, David Fries david at fries dot net, noticed that if you put your
sensors in the freezer, they return negative results, making unsigned values bad to store negative numbers and then do math on. Another popular os had this same bug fixed by the same person. ok grange@
Diffstat (limited to 'sys/dev/onewire')
-rw-r--r--sys/dev/onewire/owtemp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c
index 29250ff918f..38d990f59a9 100644
--- a/sys/dev/onewire/owtemp.c
+++ b/sys/dev/onewire/owtemp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: owtemp.c,v 1.8 2007/06/24 05:34:35 dlg Exp $ */
+/* $OpenBSD: owtemp.c,v 1.9 2007/11/28 18:26:11 todd Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -138,7 +138,7 @@ owtemp_update(void *arg)
{
struct owtemp_softc *sc = arg;
u_int8_t data[9];
- u_int16_t temp;
+ int16_t temp;
int count_perc, count_remain, val;
rw_enter_write(&sc->sc_lock);