diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-08-17 17:00:09 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-08-17 17:00:09 +0000 |
commit | bcab868a650e56d1b452903a1bf23993cf539c2e (patch) | |
tree | 9a3ec6fedf7669020372c641fca6a99f854553d9 | |
parent | 1b89d40fbf7788c75a7612b22b1dba1612e45c9a (diff) | |
download | src-bcab868a650e56d1b452903a1bf23993cf539c2e.tar.gz src-bcab868a650e56d1b452903a1bf23993cf539c2e.zip |
bhyve: Style fix for read/write_config.
-rw-r--r-- | usr.sbin/bhyve/pci_passthru.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c index e244915773be..2b2f240fafe3 100644 --- a/usr.sbin/bhyve/pci_passthru.c +++ b/usr.sbin/bhyve/pci_passthru.c @@ -143,12 +143,12 @@ pcifd_init(void) uint32_t read_config(const struct pcisel *sel, long reg, int width) { + struct pci_io pi; + if (pcifd < 0 && pcifd_init()) { return (0); } - struct pci_io pi; - bzero(&pi, sizeof(pi)); pi.pi_sel = *sel; pi.pi_reg = reg; @@ -163,12 +163,12 @@ read_config(const struct pcisel *sel, long reg, int width) void write_config(const struct pcisel *sel, long reg, int width, uint32_t data) { + struct pci_io pi; + if (pcifd < 0 && pcifd_init()) { return; } - struct pci_io pi; - bzero(&pi, sizeof(pi)); pi.pi_sel = *sel; pi.pi_reg = reg; |