The branch stable/14 has been updated by cperciva:

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

commit d3916945e4e11fae3898d497deccefb5143796d0
Author:     Andrew Turner <[email protected]>
AuthorDate: 2024-12-12 16:30:02 +0000
Commit:     Colin Percival <[email protected]>
CommitDate: 2025-04-01 17:43:57 +0000

    pci: Use a switch statement when reading ivars
    
    In pci_host_generic.c use a switch statement rather than a series
    of if statements.
    
    Reviewed by:    imp
    Sponsored by:   Arm Ltd
    Differential Revision:  https://reviews.freebsd.org/D48045
    
    (cherry picked from commit fafb43abd0dcaf2d36ec7344f46e7e19c42be888)
---
 sys/dev/pci/pci_host_generic.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
index 19a2ec419ad0..37864da9baa4 100644
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -369,13 +369,11 @@ generic_pcie_read_ivar(device_t dev, device_t child, int 
index,
        struct generic_pcie_core_softc *sc;
 
        sc = device_get_softc(dev);
-
-       if (index == PCIB_IVAR_BUS) {
+       switch (index) {
+       case PCIB_IVAR_BUS:
                *result = sc->bus_start;
                return (0);
-       }
-
-       if (index == PCIB_IVAR_DOMAIN) {
+       case PCIB_IVAR_DOMAIN:
                *result = sc->ecam;
                return (0);
        }

Reply via email to