Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Jun 2021 04:15:01 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c90902d39e7a - main - bus_child_pnpinfo: fix two stragglers
Message-ID:  <202106230415.15N4F1m9089442@gitrepo.freebsd.org>

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

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

commit c90902d39e7af742581ae1c3de910f11fb3588d2
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2021-06-23 04:10:31 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2021-06-23 04:10:31 +0000

    bus_child_pnpinfo: fix two stragglers
    
    ddfc9c4c59e2 was missing changes to two files to complete the
    bus_child_pnpinfo_str->bus_child_pnpinfo. This fixes the broken kernel
    builds.
    
    Sponsored by:           Netflix
---
 sys/dev/ofw/ofw_bus_subr.c   | 11 ++++-------
 sys/powerpc/ofw/ofw_pcibus.c |  1 +
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index 5ce8d7b7bd48..12fbafe4077f 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/bus.h>
 #include <sys/errno.h>
 #include <sys/libkern.h>
+#include <sys/sbuf.h>
 
 #include <machine/resource.h>
 
@@ -86,22 +87,18 @@ ofw_bus_gen_destroy_devinfo(struct ofw_bus_devinfo *obd)
 }
 
 int
-ofw_bus_gen_child_pnpinfo_str(device_t cbdev, device_t child, char *buf,
-    size_t buflen)
+ofw_bus_gen_child_pnpinfo(device_t cbdev, device_t child, struct sbuf *sb)
 {
 
-	*buf = '\0';
 	if (!ofw_bus_status_okay(child))
 		return (0);
 
 	if (ofw_bus_get_name(child) != NULL) {
-		strlcat(buf, "name=", buflen);
-		strlcat(buf, ofw_bus_get_name(child), buflen);
+		sbuf_printf(sb, "name=%s ", ofw_bus_get_name(child));
 	}
 
 	if (ofw_bus_get_compat(child) != NULL) {
-		strlcat(buf, " compat=", buflen);
-		strlcat(buf, ofw_bus_get_compat(child), buflen);
+		sbuf_printf(sb, "compat=%s ", ofw_bus_get_compat(child));
 	}
 
 	return (0);
diff --git a/sys/powerpc/ofw/ofw_pcibus.c b/sys/powerpc/ofw/ofw_pcibus.c
index 21ce8b04e88a..2c0a78812cc6 100644
--- a/sys/powerpc/ofw/ofw_pcibus.c
+++ b/sys/powerpc/ofw/ofw_pcibus.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/libkern.h>
 #include <sys/module.h>
 #include <sys/pciio.h>
+#include <sys/sbuf.h>
 #include <sys/smp.h>
 
 #include <dev/ofw/ofw_bus.h>



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