Module Name: src
Committed By: macallan
Date: Sat Jun 15 02:00:21 UTC 2019
Modified Files:
src/sys/dev/i2c: adadc.c fcu.c
Log Message:
explicitly initialize sensor->state
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/adadc.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/i2c/fcu.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/i2c/adadc.c
diff -u src/sys/dev/i2c/adadc.c:1.6 src/sys/dev/i2c/adadc.c:1.7
--- src/sys/dev/i2c/adadc.c:1.6 Tue Jun 26 06:03:57 2018
+++ src/sys/dev/i2c/adadc.c Sat Jun 15 02:00:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: adadc.c,v 1.6 2018/06/26 06:03:57 thorpej Exp $ */
+/* $NetBSD: adadc.c,v 1.7 2019/06/15 02:00:21 macallan Exp $ */
/*-
* Copyright (c) 2018 Michael Lorenz
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.6 2018/06/26 06:03:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adadc.c,v 1.7 2019/06/15 02:00:21 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -157,6 +157,7 @@ adadc_attach(device_t parent, device_t s
int reg = 0;
OF_getprop(ch, "reg", ®, sizeof(reg));
s = &sc->sc_sensors[sc->sc_nsensors];
+ s->state = ENVSYS_SINVALID;
/*
* this setup matches my 2x 2.5GHz PCI-X G5, Linux and
* FreeBSD hardcode these as well so we should be safe
Index: src/sys/dev/i2c/fcu.c
diff -u src/sys/dev/i2c/fcu.c:1.8 src/sys/dev/i2c/fcu.c:1.9
--- src/sys/dev/i2c/fcu.c:1.8 Mon Sep 3 16:29:31 2018
+++ src/sys/dev/i2c/fcu.c Sat Jun 15 02:00:21 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fcu.c,v 1.8 2018/09/03 16:29:31 riastradh Exp $ */
+/* $NetBSD: fcu.c,v 1.9 2019/06/15 02:00:21 macallan Exp $ */
/*-
* Copyright (c) 2018 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.8 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fcu.c,v 1.9 2019/06/15 02:00:21 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -195,6 +195,8 @@ fcu_attach(device_t parent, device_t sel
envsys_data_t *s = &sc->sc_sensors[sc->sc_nsensors];
+ s->state = ENVSYS_SINVALID;
+
if (OF_getprop(ch, "device_type", type, 32) <= 0)
goto next;
@@ -309,7 +311,7 @@ next:
sc->sc_dying = FALSE;
kthread_create(PRI_NONE, 0, curcpu(), fcu_adjust, sc, &sc->sc_thread,
- "fan control");
+ "fan control");
}
static void