git: d652801574f7 - main - bus: Fix the non-debug build

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Tue, 29 Oct 2024 11:14:45 UTC
The branch main has been updated by andrew:

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

commit d652801574f7b1aaf2a9345840861ce5d3768c85
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-10-29 11:06:57 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-10-29 11:06:57 +0000

    bus: Fix the non-debug build
    
    We read the rman type twice. Replace the second call to rman_get_type
    with the value we already have.
    
    Reported by:    bapt, Herbert J. Skuhra <herbert@gojira.at>
    Sponsored by:   Arm Ltd
---
 sys/kern/subr_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index 681971df4307..8fec2b3de139 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -4367,7 +4367,7 @@ bus_generic_rman_activate_resource(device_t dev, device_t child,
 	if (error != 0)
 		return (error);
 
-	switch (rman_get_type(r)) {
+	switch (type) {
 	case SYS_RES_IOPORT:
 	case SYS_RES_MEMORY:
 		if ((rman_get_flags(r) & RF_UNMAPPED) == 0) {