git: beb1165a018d - main - kern/rman: update debugging lines in subr_rman.c

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 21 May 2024 23:56:20 UTC
The branch main has been updated by imp:

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

commit beb1165a018d32f243c331a427dc212cf3b7febd
Author:     Elliott Mitchell <ehem+freebsd@m5p.com>
AuthorDate: 2024-05-09 04:15:53 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-05-21 23:52:21 +0000

    kern/rman: update debugging lines in subr_rman.c
    
    Rather than hard-code the function name, use __func__ instead.  Apply
    some style and adjust indentation as appropriate.  Remove the no longer
    required braces.
    
    Reviewed by: imp,jhb
    Pull Request: https://github.com/freebsd/freebsd-src/pull/1224
---
 sys/kern/subr_rman.c | 29 +++++++++++++----------------
 1 file changed, 13 insertions(+), 16 deletions(-)

diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index ffd8def66b5c..d4da67b2f16f 100644
--- a/sys/kern/subr_rman.c
+++ b/sys/kern/subr_rman.c
@@ -154,7 +154,7 @@ rman_manage_region(struct rman *rm, rman_res_t start, rman_res_t end)
 	struct resource_i *r, *s, *t;
 	int rv = 0;
 
-	DPRINTF("rman_manage_region: <%s> request: start %#jx, end %#jx\n",
+	DPRINTF("%s: <%s> request: start %#jx, end %#jx\n", __func__,
 	    rm->rm_descr, start, end);
 	if (start < rm->rm_start || end > rm->rm_end)
 		return EINVAL;
@@ -439,10 +439,9 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
 
 	rv = NULL;
 
-	DPRINTF("rman_reserve_resource_bound: <%s> request: [%#jx, %#jx], "
-	       "length %#jx, flags %x, device %s\n", rm->rm_descr, start, end,
-	       count, flags,
-	       dev == NULL ? "<null>" : device_get_nameunit(dev));
+	DPRINTF("%s: <%s> request: [%#jx, %#jx], length %#jx, flags %x, "
+	    "device %s\n", __func__, rm->rm_descr, start, end, count, flags,
+	    dev == NULL ? "<null>" : device_get_nameunit(dev));
 	KASSERT(count != 0, ("%s: attempted to allocate an empty range",
 	    __func__));
 	KASSERT((flags & RF_FIRSTSHARE) == 0,
@@ -452,19 +451,17 @@ rman_reserve_resource_bound(struct rman *rm, rman_res_t start, rman_res_t end,
 	mtx_lock(rm->rm_mtx);
 
 	r = TAILQ_FIRST(&rm->rm_list);
-	if (r == NULL) {
-	    DPRINTF("NULL list head\n");
-	} else {
-	    DPRINTF("rman_reserve_resource_bound: trying %#jx <%#jx,%#jx>\n",
-		    r->r_end, start, count-1);
-	}
+	if (r == NULL)
+		DPRINTF("NULL list head\n");
+	else
+		DPRINTF("%s: trying %#jx <%#jx,%#jx>\n", __func__, r->r_end,
+		    start, count-1);
+
 	for (r = TAILQ_FIRST(&rm->rm_list);
 	     r && r->r_end < start + count - 1;
-	     r = TAILQ_NEXT(r, r_link)) {
-		;
-		DPRINTF("rman_reserve_resource_bound: tried %#jx <%#jx,%#jx>\n",
-			r->r_end, start, count-1);
-	}
+	     r = TAILQ_NEXT(r, r_link))
+		DPRINTF("%s: tried %#jx <%#jx,%#jx>\n", __func__, r->r_end,
+		    start, count-1);
 
 	if (r == NULL) {
 		DPRINTF("could not find a region\n");