bhyve: Deduplicate some code in modify_bar_registration()
No functional change intended. Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D40877
This commit is contained in:
parent
bfc47586ac
commit
0dea4f064d
@ -615,9 +615,6 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration)
|
||||
error = register_inout(&iop);
|
||||
} else
|
||||
error = unregister_inout(&iop);
|
||||
if (pe->pe_baraddr != NULL)
|
||||
(*pe->pe_baraddr)(pi, idx, registration,
|
||||
pi->pi_bar[idx].addr);
|
||||
break;
|
||||
case PCIBAR_MEM32:
|
||||
case PCIBAR_MEM64:
|
||||
@ -633,21 +630,18 @@ modify_bar_registration(struct pci_devinst *pi, int idx, int registration)
|
||||
error = register_mem(&mr);
|
||||
} else
|
||||
error = unregister_mem(&mr);
|
||||
if (pe->pe_baraddr != NULL)
|
||||
(*pe->pe_baraddr)(pi, idx, registration,
|
||||
pi->pi_bar[idx].addr);
|
||||
break;
|
||||
case PCIBAR_ROM:
|
||||
error = 0;
|
||||
if (pe->pe_baraddr != NULL)
|
||||
(*pe->pe_baraddr)(pi, idx, registration,
|
||||
pi->pi_bar[idx].addr);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
assert(error == 0);
|
||||
|
||||
if (pe->pe_baraddr != NULL)
|
||||
(*pe->pe_baraddr)(pi, idx, registration, pi->pi_bar[idx].addr);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user