Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c Use const nodes. Let sysctl_createv initialize s...
details: https://anonhg.NetBSD.org/src/rev/86a9c1008d79
branches: trunk
changeset: 780557:86a9c1008d79
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sun Jul 29 07:04:09 2012 +0000
description:
Use const nodes. Let sysctl_createv initialize sysctl_data.
diffstat:
sys/dev/i2c/g760a.c | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diffs (48 lines):
diff -r 6be7fdb85934 -r 86a9c1008d79 sys/dev/i2c/g760a.c
--- a/sys/dev/i2c/g760a.c Sun Jul 29 02:58:27 2012 +0000
+++ b/sys/dev/i2c/g760a.c Sun Jul 29 07:04:09 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: g760a.c,v 1.3 2012/07/28 23:03:47 matt Exp $ */
+/* $NetBSD: g760a.c,v 1.4 2012/07/29 07:04:09 mlelstv Exp $ */
/*-
* Copyright (C) 2008 A.Leo.
@@ -32,7 +32,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: g760a.c,v 1.3 2012/07/28 23:03:47 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: g760a.c,v 1.4 2012/07/29 07:04:09 mlelstv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -218,11 +218,11 @@
{
int error;
int ret;
- struct sysctlnode* me = NULL, * node = NULL;
+ const struct sysctlnode *me, *node;
sc->sc_sme = sysmon_envsys_create();
- ret = sysctl_createv(NULL, 0, NULL, (void *)&me,
+ ret = sysctl_createv(NULL, 0, NULL, &me,
CTLFLAG_READWRITE,
CTLTYPE_NODE, device_xname(sc->sc_dev), NULL,
NULL, 0, NULL, 0,
@@ -236,13 +236,11 @@
if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor))
goto out;
- ret = sysctl_createv(NULL, 0, NULL, (void *)&node,
+ ret = sysctl_createv(NULL, 0, NULL, &node,
CTLFLAG_READWRITE,
CTLTYPE_INT, "rpm", sc->sc_sensor.desc,
- sysctl_g760a_rpm, 0x42, NULL, 0,
+ sysctl_g760a_rpm, 0x42, (void*)sc, 0,
CTL_MACHDEP, me->sysctl_num, CTL_CREATE, CTL_EOL);
- if (node != NULL)
- node->sysctl_data = sc;
sc->sc_sme->sme_name = device_xname(sc->sc_dev);
sc->sc_sme->sme_cookie = sc;
Home |
Main Index |
Thread Index |
Old Index