diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-07-17 11:43:11 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-07-17 11:43:11 +0000 |
| commit | 1758dcd6f4a1b12b50ce8536eb4e54f072a552e4 (patch) | |
| tree | d787e3c2aae0830614ed50811d5e7198583c7843 /sys/dev | |
| parent | 736869e50baac65b7069be0111fe2f45cd4d4bf1 (diff) | |
wsdisplay(4): KASSERT(a && b) -> KASSERT(a); KASSERT(b)
Better diagnostics this way. No other functional change. Omit
needless #ifdef DIAGNOSTIC while here; the compiler can optimize the
dead code away.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/wscons/wsdisplay.c | 11 | ||||
| -rw-r--r-- | sys/dev/wscons/wsdisplay_vcons.c | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index d55fd52b02d..c304f4fea9a 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.163 2021/12/31 14:19:57 riastradh Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.163 2021/12/31 14:19:57 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.164 2022/07/17 11:43:11 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_wsdisplay_compat.h" @@ -790,12 +790,13 @@ static bool wsdisplay_suspend(device_t dv, const pmf_qual_t *qual) { struct wsdisplay_softc *sc = device_private(dv); -#ifdef DIAGNOSTIC struct wsscreen *scr = sc->sc_focus; + if (sc->sc_flags & SC_XATTACHED) { - KASSERT(scr && scr->scr_syncops); + KASSERT(scr); + KASSERT(scr->scr_syncops); } -#endif + #if 1 /* * XXX X servers should have been detached earlier. diff --git a/sys/dev/wscons/wsdisplay_vcons.c b/sys/dev/wscons/wsdisplay_vcons.c index 3e7b63d38b7..4a6c37db188 100644 --- a/sys/dev/wscons/wsdisplay_vcons.c +++ b/sys/dev/wscons/wsdisplay_vcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.60 2022/07/17 11:31:47 riastradh Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.61 2022/07/17 11:43:11 riastradh Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.60 2022/07/17 11:31:47 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.61 2022/07/17 11:43:11 riastradh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1317,7 +1317,8 @@ vcons_putwschar(struct vcons_screen *scr, struct wsdisplay_char *wsc) struct rasops_info *ri; int error; - KASSERT(scr != NULL && wsc != NULL); + KASSERT(scr != NULL); + KASSERT(wsc != NULL); ri = &scr->scr_ri; @@ -1356,7 +1357,8 @@ vcons_getwschar(struct vcons_screen *scr, struct wsdisplay_char *wsc) struct rasops_info *ri; int fg, bg, ul; - KASSERT(scr != NULL && wsc != NULL); + KASSERT(scr != NULL); + KASSERT(wsc != NULL); ri = &scr->scr_ri; |
