diff options
author | phk <phk@FreeBSD.org> | 2002-10-15 18:56:13 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-15 18:56:13 +0000 |
commit | 2208595682358e3c4bb97e4cb1183565861a49cd (patch) | |
tree | 0a42e090b7907948570764b7af7018334b25bac7 /sys | |
parent | 9ce3340232ae0c31d3a8917e860e7b1ca951f732 (diff) | |
download | FreeBSD-src-2208595682358e3c4bb97e4cb1183565861a49cd.zip FreeBSD-src-2208595682358e3c4bb97e4cb1183565861a49cd.tar.gz |
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
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/subr_bus.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index f40839b..bf63bad 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 |