mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
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)
This commit is contained in:
parent
3af851edd0
commit
d3916945e4
1 changed files with 3 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue