Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern autoconf(9): Clarify assertions about iattr in conf...
details: https://anonhg.NetBSD.org/src/rev/8e9f8aa16e89
branches: trunk
changeset: 373621:8e9f8aa16e89
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Feb 22 17:00:16 2023 +0000
description:
autoconf(9): Clarify assertions about iattr in config_search.
diffstat:
sys/kern/subr_autoconf.c | 22 ++++++++++++++++------
1 files changed, 16 insertions(+), 6 deletions(-)
diffs (43 lines):
diff -r 93708c890cb9 -r 8e9f8aa16e89 sys/kern/subr_autoconf.c
--- a/sys/kern/subr_autoconf.c Wed Feb 22 08:09:09 2023 +0000
+++ b/sys/kern/subr_autoconf.c Wed Feb 22 17:00:16 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.306 2022/09/13 09:43:33 riastradh Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.307 2023/02/22 17:00:16 riastradh 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.306 2022/09/13 09:43:33 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_autoconf.c,v 1.307 2023/02/22 17:00:16 riastradh Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -1143,10 +1143,20 @@
struct matchinfo m;
KASSERT(config_initialized);
- KASSERT(!args->iattr ||
- cfdriver_get_iattr(parent->dv_cfdriver, args->iattr));
- KASSERT(args->iattr ||
- cfdriver_iattr_count(parent->dv_cfdriver) < 2);
+ KASSERTMSG((!args->iattr ||
+ cfdriver_get_iattr(parent->dv_cfdriver, args->iattr)),
+ "%s searched for child at interface attribute %s,"
+ " but device %s(4) has no such interface attribute in config(5)",
+ device_xname(parent), args->iattr,
+ parent->dv_cfdriver->cd_name);
+ KASSERTMSG((args->iattr ||
+ cfdriver_iattr_count(parent->dv_cfdriver) < 2),
+ "%s searched for child without interface attribute,"
+ " needed to disambiguate among the %d declared for in %s(4)"
+ " in config(5)",
+ device_xname(parent),
+ cfdriver_iattr_count(parent->dv_cfdriver),
+ parent->dv_cfdriver->cd_name);
m.fn = args->submatch; /* N.B. union */
m.parent = parent;
Home |
Main Index |
Thread Index |
Old Index