From 2208595682358e3c4bb97e4cb1183565861a49cd Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 15 Oct 2002 18:56:13 +0000 Subject: [PATCH] Use ; not , as statement separator in PDEBUG() macro. Ignoring a NULL dev in device_set_ivars() sounds wrong, KASSERT it to non-NULL instead. Do the same for device_get_ivars() for reasons of symmetry, though it probably would have yielded a panic anyway, this gives more precise diagnostics. Absentmindedly nodded OK to by: jhb --- sys/kern/subr_bus.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f40839bfe98e..bf63baddb2ef 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -137,7 +137,7 @@ TUNABLE_INT("bus.debug", &bus_debug); SYSCTL_INT(_debug, OID_AUTO, bus_debug, CTLFLAG_RW, &bus_debug, 0, "Debug bus code"); -#define PDEBUG(a) if (bus_debug) {printf("%s:%d: ", __func__, __LINE__), printf a, printf("\n");} +#define PDEBUG(a) if (bus_debug) {printf("%s:%d: ", __func__, __LINE__), printf a; printf("\n");} #define DEVICENAME(d) ((d)? device_get_name(d): "no device") #define DRIVERNAME(d) ((d)? d->name : "no driver") #define DEVCLANAME(d) ((d)? d->name : "no devclass") @@ -1265,18 +1265,17 @@ device_set_softc(device_t dev, void *softc) void * device_get_ivars(device_t dev) { + + KASSERT(dev != NULL, ("device_get_ivars(NULL, ...)")); return (dev->ivars); } void device_set_ivars(device_t dev, void * ivars) { - if (!dev) - return; + KASSERT(dev != NULL, ("device_set_ivars(NULL, ...)")); dev->ivars = ivars; - - return; } device_state_t