Source-Changes-HG archive

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

[src/pgoyette-localcount]: src/sys/kern Use KASSERTMSG() to ensure that the d...



details:   https://anonhg.NetBSD.org/src/rev/3605a689f18e
branches:  pgoyette-localcount
changeset: 852903:3605a689f18e
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Apr 25 09:03:03 2017 +0000

description:
Use KASSERTMSG() to ensure that the device has a localcount.

diffstat:

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

diffs (30 lines):

diff -r 56bb3d414b55 -r 3605a689f18e sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c  Mon Mar 20 06:51:32 2017 +0000
+++ b/sys/kern/subr_autoconf.c  Tue Apr 25 09:03:03 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.246.2.8 2017/03/20 06:57:47 pgoyette Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.246.2.9 2017/04/25 09:03:03 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.246.2.8 2017/03/20 06:57:47 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.246.2.9 2017/04/25 09:03:03 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -2252,8 +2252,9 @@
 device_acquire(device_t dv)
 {
 
-       if (dv->dv_localcnt != NULL)
-               localcount_acquire(dv->dv_localcnt);
+       KASSERTMSG(dv->dv_localcnt != NULL, "%s: device %s has no localcnt!",
+           __func__, dv->dv_cfdriver->cd_name)
+       localcount_acquire(dv->dv_localcnt);
 }
 
 /*



Home | Main Index | Thread Index | Old Index