git: 2f98fd7fe800 - releng/15.2 - acpi_pci_link: Remove a helper variable from _PRS parsing

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 16:05:02 UTC
The branch releng/15.2 has been updated by cperciva:

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

commit 2f98fd7fe8007db0793997d32c5ffa41317d6469
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-11-14 16:02:38 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-11-19 16:04:39 +0000

    acpi_pci_link: Remove a helper variable from _PRS parsing
    
    Approved by:    re (cperciva)
    Tested by:      cperciva
    
    (cherry picked from commit df10f7b7500c129c48a477e94039c4e0d2711b54)
    (cherry picked from commit 0af24d1fe82f1161cab8f10ba7f23cc3bee7dc11)
---
 sys/dev/acpica/acpi_pci_link.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c
index cb6adee87252..378e4631e97d 100644
--- a/sys/dev/acpica/acpi_pci_link.c
+++ b/sys/dev/acpica/acpi_pci_link.c
@@ -275,7 +275,7 @@ link_add_prs(ACPI_RESOURCE *res, void *context)
 	struct link *link;
 	UINT8 *irqs = NULL;
 	UINT32 *ext_irqs = NULL;
-	int i, is_ext_irq = 1;
+	int i;
 
 	ACPI_SERIAL_ASSERT(pci_link);
 	req = (struct link_res_request *)context;
@@ -299,8 +299,6 @@ link_add_prs(ACPI_RESOURCE *res, void *context)
 		req->in_dpf = DPF_OUTSIDE;
 		break;
 	case ACPI_RESOURCE_TYPE_IRQ:
-		is_ext_irq = 0;
-		/* fall through */
 	case ACPI_RESOURCE_TYPE_EXTENDED_IRQ:
 		/*
 		 * Don't parse resources if we are in a DPF set that we are
@@ -325,7 +323,7 @@ link_add_prs(ACPI_RESOURCE *res, void *context)
 		 * _SRS.
 		 */
 		tmp = &link->l_prs_template;
-		if (is_ext_irq) {
+		if (res->Type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) {
 			bcopy(res, tmp, ACPI_RS_SIZE(tmp->Data.ExtendedIrq));
 
 			/*
@@ -356,7 +354,7 @@ link_add_prs(ACPI_RESOURCE *res, void *context)
 		link->l_irqs = malloc(sizeof(int) * link->l_num_irqs,
 		    M_PCI_LINK, M_WAITOK | M_ZERO);
 		for (i = 0; i < link->l_num_irqs; i++) {
-			if (is_ext_irq) {
+			if (ext_irqs != NULL) {
 				link->l_irqs[i] = ext_irqs[i];
 				if (ext_irqs[i] >= NUM_ISA_INTERRUPTS)
 					link->l_isa_irq = false;