Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2024 07:18:09 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 7030980bc9aa - main - bus: improve null_add_child() panic message
Message-ID:  <202412200718.4BK7I99K073654@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=7030980bc9aa62aaf25ffab44e24af854c57a9b1

commit 7030980bc9aa62aaf25ffab44e24af854c57a9b1
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-12-18 21:29:10 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-12-20 07:16:04 +0000

    bus: improve null_add_child() panic message
    
    When null_add_child() panics add the bus device name/unit and the new
    unit as this will immediately reveal the parent missing the
      DEVMETHOD(bus_add_child, ...)
    entry.
    
    Reviewed by:    imp
    Differential Revision: https://reviews.freebsd.org/D48151
---
 sys/kern/bus_if.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index e42dc6d31441..74114ff7baee 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -63,7 +63,8 @@ CODE {
 	    int unit)
 	{
 
-		panic("bus_add_child is not implemented");
+		panic("%s: bus_add_child is not implemented, name '%s', "
+		    "unit %d", device_get_nameunit(bus), name, unit);
 	}
 
 	static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412200718.4BK7I99K073654>