Source-Changes-HG archive

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

[src/trunk]: src/sys/kern As suggested by christos@, use KASSERTMSG()



details:   https://anonhg.NetBSD.org/src/rev/cf97f38f08ac
branches:  trunk
changeset: 816634:cf97f38f08ac
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Jul 15 01:13:10 2016 +0000

description:
As suggested by christos@, use KASSERTMSG()

diffstat:

 sys/kern/subr_autoconf.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 6f04789461b7 -r cf97f38f08ac sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Thu Jul 14 22:39:40 2016 +0000
+++ b/sys/kern/subr_autoconf.c  Fri Jul 15 01:13:10 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.244 2016/07/14 21:57:06 pgoyette Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.245 2016/07/15 01:13:10 pgoyette Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.244 2016/07/14 21:57:06 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.245 2016/07/15 01:13:10 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1370,8 +1370,10 @@
                return NULL;
 
        /* get memory for all device vars */
-       KASSERT((ca->ca_flags & DVF_PRIV_ALLOC)
-           || ca->ca_devsize >= sizeof(struct device));
+       KASSERTMSG((ca->ca_flags & DVF_PRIV_ALLOC)
+           || ca->ca_devsize >= sizeof(struct device),
+           "config_devalloc: %s (%zu < %zu)", cf->cf_atname, ca->ca_devsize,
+           sizeof(struct device));
        if (ca->ca_devsize > 0) {
                dev_private = kmem_zalloc(ca->ca_devsize, KM_SLEEP);
                if (dev_private == NULL)



Home | Main Index | Thread Index | Old Index