summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2010-02-18 23:34:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2010-02-18 23:34:06 +0000
commitfbbbb4bd7f697ebc9b3f3b682bd69c04eaa6ec58 (patch)
treea546795772e453ee79b6640a5208c4c7582451db /sys
parente11b5ca75b74e05e15a6af0949133ee9a7458598 (diff)
do not zero fields which are already zero; from cnst
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uthum.c7
-rw-r--r--sys/dev/usb/utrh.c7
2 files changed, 2 insertions, 12 deletions
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c
index 1e677919f52..7bda0030e72 100644
--- a/sys/dev/usb/uthum.c
+++ b/sys/dev/usb/uthum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthum.c,v 1.7 2010/02/17 14:06:10 yuo Exp $ */
+/* $OpenBSD: uthum.c,v 1.8 2010/02/18 23:34:05 deraadt Exp $ */
/*
* Copyright (c) 2009 Yojiro UO <yuo@nui.org>
@@ -179,17 +179,12 @@ uthum_attach(struct device *parent, struct device *self, void *aux)
switch (sc->sc_sensortype) {
case UTHUM_TYPE_SHT1x:
- strlcpy(sc->sc_sensor[UTHUM_TEMP].desc, "temp",
- sizeof(sc->sc_sensor[UTHUM_TEMP].desc));
sc->sc_sensor[UTHUM_TEMP].type = SENSOR_TEMP;
- sc->sc_sensor[UTHUM_TEMP].status = SENSOR_S_UNSPEC;
sc->sc_sensor[UTHUM_TEMP].flags = SENSOR_FINVALID;
strlcpy(sc->sc_sensor[UTHUM_HUMIDITY].desc, "humidity",
sizeof(sc->sc_sensor[UTHUM_HUMIDITY].desc));
sc->sc_sensor[UTHUM_HUMIDITY].type = SENSOR_PERCENT;
- sc->sc_sensor[UTHUM_HUMIDITY].value = 0;
- sc->sc_sensor[UTHUM_HUMIDITY].status = SENSOR_S_UNSPEC;
sc->sc_sensor[UTHUM_HUMIDITY].flags = SENSOR_FINVALID;
sensor_attach(&sc->sc_sensordev, &sc->sc_sensor[UTHUM_TEMP]);
diff --git a/sys/dev/usb/utrh.c b/sys/dev/usb/utrh.c
index 7e6ca9e3bdf..b19761e1282 100644
--- a/sys/dev/usb/utrh.c
+++ b/sys/dev/usb/utrh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utrh.c,v 1.2 2009/12/19 05:49:58 yuo Exp $ */
+/* $OpenBSD: utrh.c,v 1.3 2010/02/18 23:34:05 deraadt Exp $ */
/*
* Copyright (c) 2009 Yojiro UO <yuo@nui.org>
@@ -151,17 +151,12 @@ utrh_attach(struct device *parent, struct device *self, void *aux)
strlcpy(sc->sc_sensordev.xname, sc->sc_hdev.sc_dev.dv_xname,
sizeof(sc->sc_sensordev.xname));
- strlcpy(sc->sc_sensor[UTRH_TEMP].desc, "temp",
- sizeof(sc->sc_sensor[UTRH_TEMP].desc));
sc->sc_sensor[UTRH_TEMP].type = SENSOR_TEMP;
- sc->sc_sensor[UTRH_TEMP].status = SENSOR_S_UNSPEC;
sc->sc_sensor[UTRH_TEMP].flags = SENSOR_FINVALID;
strlcpy(sc->sc_sensor[UTRH_HUMIDITY].desc, "humidity",
sizeof(sc->sc_sensor[UTRH_HUMIDITY].desc));
sc->sc_sensor[UTRH_HUMIDITY].type = SENSOR_PERCENT;
- sc->sc_sensor[UTRH_HUMIDITY].value = 0;
- sc->sc_sensor[UTRH_HUMIDITY].status = SENSOR_S_UNSPEC;
sc->sc_sensor[UTRH_HUMIDITY].flags = SENSOR_FINVALID;
sensor_attach(&sc->sc_sensordev, &sc->sc_sensor[UTRH_TEMP]);