diff options
| author | dsl <dsl@NetBSD.org> | 2012-06-02 21:36:41 +0000 |
|---|---|---|
| committer | dsl <dsl@NetBSD.org> | 2012-06-02 21:36:41 +0000 |
| commit | 7c283e7753365d4f53a7263a22beeeb5de8d7c5b (patch) | |
| tree | b8a9f9ee0b7068a5d755d6b6d2eeb4486987cd94 /sys/dev/bluetooth | |
| parent | 284643b9f337a125e69cb0b05e69ce4fa4f75a74 (diff) | |
Add some pre-processor magic to verify that the type of the data item
passed to sysctl_createv() actually matches the declared type for
the item itself.
In the places where the caller specifies a function and a structure
address (typically the 'softc') an explicit (void *) cast is now needed.
Fixes bugs in sys/dev/acpi/asus_acpi.c sys/dev/bluetooth/bcsp.c
sys/kern/vfs_bio.c sys/miscfs/syncfs/sync_subr.c and setting
AcpiGbl_EnableAmlDebugObject.
(mostly passing the address of a uint64_t when typed as CTLTYPE_INT).
I've test built quite a few kernels, but there may be some unfixed MD
fallout. Most likely passing &char[] to char *.
Also add CTLFLAG_UNSIGNED for unsiged decimals - not set yet.
Diffstat (limited to 'sys/dev/bluetooth')
| -rw-r--r-- | sys/dev/bluetooth/bcsp.c | 6 | ||||
| -rw-r--r-- | sys/dev/bluetooth/btmagic.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/bluetooth/bcsp.c b/sys/dev/bluetooth/bcsp.c index 781412a8404..039ec03155a 100644 --- a/sys/dev/bluetooth/bcsp.c +++ b/sys/dev/bluetooth/bcsp.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcsp.c,v 1.20 2011/07/31 13:51:53 uebayasi Exp $ */ +/* $NetBSD: bcsp.c,v 1.21 2012/06/02 21:36:43 dsl Exp $ */ /* * Copyright (c) 2007 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.20 2011/07/31 13:51:53 uebayasi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bcsp.c,v 1.21 2012/06/02 21:36:43 dsl Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -300,7 +300,7 @@ bcsp_attach(device_t parent __unused, device_t self, void *aux __unused) } bcsp_node_num = node->sysctl_num; if ((rc = sysctl_createv(&sc->sc_log, 0, NULL, &node, - CTLFLAG_READWRITE, CTLTYPE_INT, + CTLFLAG_READWRITE, CTLTYPE_BOOL, "muzzled", SYSCTL_DESCR("muzzled for Link-establishment Layer"), NULL, 0, &sc->sc_le_muzzled, 0, CTL_HW, bcsp_node_num, CTL_CREATE, CTL_EOL)) != 0) { diff --git a/sys/dev/bluetooth/btmagic.c b/sys/dev/bluetooth/btmagic.c index 3394ef5d51d..5d550647339 100644 --- a/sys/dev/bluetooth/btmagic.c +++ b/sys/dev/bluetooth/btmagic.c @@ -1,4 +1,4 @@ -/* $NetBSD: btmagic.c,v 1.2 2012/04/03 09:32:53 plunky Exp $ */ +/* $NetBSD: btmagic.c,v 1.3 2012/06/02 21:36:43 dsl Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -85,7 +85,7 @@ *****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.2 2012/04/03 09:32:53 plunky Exp $"); +__KERNEL_RCSID(0, "$NetBSD: btmagic.c,v 1.3 2012/06/02 21:36:43 dsl Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -342,7 +342,7 @@ btmagic_attach(device_t parent, device_t self, void *aux) CTLTYPE_INT, "soft_resolution", NULL, btmagic_sysctl_resolution, 0, - sc, 0, + (void *)sc, 0, CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL); @@ -369,7 +369,7 @@ btmagic_attach(device_t parent, device_t self, void *aux) CTLTYPE_INT, "scroll_downscale_factor", NULL, btmagic_sysctl_scale, 0, - sc, 0, + (void *)sc, 0, CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL); } |
