Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wsfb genfb(4): KASSERT(a && b) -> KASSERT(a); KASSER...



details:   https://anonhg.NetBSD.org/src/rev/2763b2fd5a68
branches:  trunk
changeset: 368527:2763b2fd5a68
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Jul 17 13:10:04 2022 +0000

description:
genfb(4): KASSERT(a && b) -> KASSERT(a); KASSERT(b)

Better diagnostics.  No other functional change.

diffstat:

 sys/dev/wsfb/genfb.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (50 lines):

diff -r 1620f964e556 -r 2763b2fd5a68 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c      Sun Jul 17 11:44:30 2022 +0000
+++ b/sys/dev/wsfb/genfb.c      Sun Jul 17 13:10:04 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfb.c,v 1.87 2022/07/09 13:37:12 rin Exp $ */
+/*     $NetBSD: genfb.c,v 1.88 2022/07/17 13:10:04 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.87 2022/07/09 13:37:12 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.88 2022/07/17 13:10:04 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -608,7 +608,8 @@
                        ri->ri_bpos = bits * 2;
                } else if (is_swapped) {
                        /* byte-swapped, must be 32 bpp */
-                       KASSERT(ri->ri_depth == 32 && bits == 8);
+                       KASSERT(ri->ri_depth == 32);
+                       KASSERT(bits == 8);
                        ri->ri_rpos = 8;
                        ri->ri_gpos = 16;
                        ri->ri_bpos = 24;
@@ -879,8 +880,8 @@
 {
        struct genfb_softc *sc = device_private(dev);
 
-       KASSERT(sc->sc_brightness != NULL &&
-               sc->sc_brightness->gpc_upd_parameter != NULL);
+       KASSERT(sc->sc_brightness != NULL);
+       KASSERT(sc->sc_brightness->gpc_upd_parameter != NULL);
 
        (void)sc->sc_brightness->gpc_upd_parameter(
            sc->sc_brightness->gpc_cookie, GENFB_BRIGHTNESS_STEP);
@@ -891,8 +892,8 @@
 {
        struct genfb_softc *sc = device_private(dev);
 
-       KASSERT(sc->sc_brightness != NULL &&
-               sc->sc_brightness->gpc_upd_parameter != NULL);
+       KASSERT(sc->sc_brightness != NULL);
+       KASSERT(sc->sc_brightness->gpc_upd_parameter != NULL);
 
        (void)sc->sc_brightness->gpc_upd_parameter(
            sc->sc_brightness->gpc_cookie, - GENFB_BRIGHTNESS_STEP);



Home | Main Index | Thread Index | Old Index