From 2c5ad75eb4b5f15c43c629437107afee437804a9 Mon Sep 17 00:00:00 2001 From: hannken Date: Sat, 1 Jan 2022 11:57:44 +0000 Subject: [PATCH] Protect KASSERT() with "#ifdef DIAGNOSTIC" as its expression is undefined otherwise. --- sys/dev/wscons/wsemul_sun.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/wscons/wsemul_sun.c b/sys/dev/wscons/wsemul_sun.c index 3b80da327aec..1d03af4644aa 100644 --- a/sys/dev/wscons/wsemul_sun.c +++ b/sys/dev/wscons/wsemul_sun.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsemul_sun.c,v 1.33 2018/09/03 16:29:34 riastradh Exp $ */ +/* $NetBSD: wsemul_sun.c,v 1.34 2022/01/01 11:57:44 hannken Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -33,7 +33,7 @@ /* XXX DESCRIPTION/SOURCE OF INFORMATION */ #include -__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.33 2018/09/03 16:29:34 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.34 2022/01/01 11:57:44 hannken Exp $"); #include #include @@ -176,7 +176,9 @@ wsemul_sun_attach(int console, const struct wsscreen_descr *type, if (console) { edp = &wsemul_sun_console_emuldata; +#ifdef DIAGNOSTIC KASSERT(edp->console == 1); +#endif } else { edp = malloc(sizeof *edp, M_DEVBUF, M_WAITOK);