git: e696777efa60 - stable/13 - bhyve: Annotate unused function parameters

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Thu, 26 Jan 2023 19:47:46 UTC
The branch stable/13 has been updated by jhb:

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

commit e696777efa6086d0c1a78aad3a9b8c967166acb3
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-10-08 15:22:38 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-01-26 19:30:45 +0000

    bhyve: Annotate unused function parameters
    
    MFC after:      1 week
    
    (cherry picked from commit 98d920d9cf0b439ea351c60353626946971684f6)
---
 sys/amd64/vmm/vmm_instruction_emul.c | 29 +++++++++++++------------
 usr.sbin/bhyve/block_if.c            |  5 +++--
 usr.sbin/bhyve/bootrom.c             |  5 +++--
 usr.sbin/bhyve/fwctl.c               | 14 ++++++------
 usr.sbin/bhyve/gdb.c                 |  6 +++---
 usr.sbin/bhyve/inout.c               |  4 ++--
 usr.sbin/bhyve/mevent.c              |  2 +-
 usr.sbin/bhyve/mptbl.c               |  4 ++--
 usr.sbin/bhyve/net_backends.c        | 16 +++++++-------
 usr.sbin/bhyve/pci_ahci.c            | 15 +++++++------
 usr.sbin/bhyve/pci_e82545.c          | 21 +++++++++---------
 usr.sbin/bhyve/pci_emul.c            | 42 +++++++++++++++++++-----------------
 usr.sbin/bhyve/pci_fbuf.c            |  9 ++++----
 usr.sbin/bhyve/pci_hda.c             | 18 +++++++++-------
 usr.sbin/bhyve/pci_hostbridge.c      |  6 +++---
 usr.sbin/bhyve/pci_irq.c             |  2 +-
 usr.sbin/bhyve/pci_lpc.c             | 23 ++++++++++----------
 usr.sbin/bhyve/pci_passthru.c        | 16 +++++++-------
 usr.sbin/bhyve/pci_uart.c            | 14 ++++++------
 usr.sbin/bhyve/pci_virtio_9p.c       | 12 +++++------
 usr.sbin/bhyve/pci_virtio_block.c    |  9 +++++---
 usr.sbin/bhyve/pci_virtio_console.c  | 15 +++++++------
 usr.sbin/bhyve/pci_virtio_input.c    |  5 +++--
 usr.sbin/bhyve/pci_virtio_net.c      |  5 +++--
 usr.sbin/bhyve/pci_virtio_rnd.c      |  3 ++-
 usr.sbin/bhyve/pci_virtio_scsi.c     | 15 ++++++-------
 usr.sbin/bhyve/pci_xhci.c            | 29 +++++++++++++------------
 usr.sbin/bhyve/pctestdev.c           | 17 ++++++++-------
 usr.sbin/bhyve/pm.c                  | 30 +++++++++++++-------------
 usr.sbin/bhyve/post.c                |  4 ++--
 usr.sbin/bhyve/rfb.c                 |  7 +++---
 usr.sbin/bhyve/rtc.c                 |  4 ++--
 usr.sbin/bhyve/snapshot.c            |  2 +-
 usr.sbin/bhyve/usb_mouse.c           |  8 +++----
 usr.sbin/bhyve/vga.c                 | 21 +++++++++---------
 usr.sbin/bhyve/virtio.c              | 13 +++++------
 usr.sbin/bhyve/xmsr.c                |  6 ++++--
 37 files changed, 238 insertions(+), 218 deletions(-)

diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c
index 06dffe6a80b9..0474147e68ff 100644
--- a/sys/amd64/vmm/vmm_instruction_emul.c
+++ b/sys/amd64/vmm/vmm_instruction_emul.c
@@ -624,8 +624,7 @@ emulate_mov(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 
 static int
 emulate_movx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-	     mem_region_read_t memread, mem_region_write_t memwrite,
-	     void *arg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused, void *arg)
 {
 	int error, size;
 	enum vm_reg_name reg;
@@ -712,9 +711,9 @@ emulate_movx(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
  * Helper function to calculate and validate a linear address.
  */
 static int
-get_gla(void *vm, int vcpuid, struct vie *vie, struct vm_guest_paging *paging,
-    int opsize, int addrsize, int prot, enum vm_reg_name seg,
-    enum vm_reg_name gpr, uint64_t *gla, int *fault)
+get_gla(void *vm, int vcpuid, struct vie *vie __unused,
+    struct vm_guest_paging *paging, int opsize, int addrsize, int prot,
+    enum vm_reg_name seg, enum vm_reg_name gpr, uint64_t *gla, int *fault)
 {
 	struct seg_desc desc;
 	uint64_t cr0, val, rflags;
@@ -948,7 +947,7 @@ done:
 
 static int
 emulate_stos(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-    struct vm_guest_paging *paging, mem_region_read_t memread,
+    struct vm_guest_paging *paging __unused, mem_region_read_t memread __unused,
     mem_region_write_t memwrite, void *arg)
 {
 	int error, opsize, repeat;
@@ -1186,7 +1185,7 @@ emulate_or(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 
 static int
 emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-	    mem_region_read_t memread, mem_region_write_t memwrite, void *arg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused, void *arg)
 {
 	int error, size;
 	uint64_t regop, memop, op1, op2, rflags, rflags2;
@@ -1278,7 +1277,7 @@ emulate_cmp(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 
 static int
 emulate_test(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-    mem_region_read_t memread, mem_region_write_t memwrite, void *arg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused, void *arg)
 {
 	int error, size;
 	uint64_t op1, rflags, rflags2;
@@ -1328,7 +1327,7 @@ emulate_test(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 static int
 emulate_bextr(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
     struct vm_guest_paging *paging, mem_region_read_t memread,
-    mem_region_write_t memwrite, void *arg)
+    mem_region_write_t memwrite __unused, void *arg)
 {
 	uint64_t src1, src2, dst, rflags;
 	unsigned start, len;
@@ -1404,7 +1403,7 @@ done:
 
 static int
 emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-	    mem_region_read_t memread, mem_region_write_t memwrite, void *arg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused, void *arg)
 {
 	int error, size;
 	uint64_t nval, rflags, rflags2, val1, val2;
@@ -1460,7 +1459,7 @@ emulate_add(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 
 static int
 emulate_sub(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-	    mem_region_read_t memread, mem_region_write_t memwrite, void *arg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused, void *arg)
 {
 	int error, size;
 	uint64_t nval, rflags, rflags2, val1, val2;
@@ -1660,7 +1659,7 @@ emulate_pop(void *vm, int vcpuid, uint64_t mmio_gpa, struct vie *vie,
 
 static int
 emulate_group1(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-    struct vm_guest_paging *paging, mem_region_read_t memread,
+    struct vm_guest_paging *paging __unused, mem_region_read_t memread,
     mem_region_write_t memwrite, void *memarg)
 {
 	int error;
@@ -1688,7 +1687,8 @@ emulate_group1(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 
 static int
 emulate_bittest(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-    mem_region_read_t memread, mem_region_write_t memwrite, void *memarg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused,
+    void *memarg)
 {
 	uint64_t val, rflags;
 	int error, bitmask, bitoff;
@@ -1730,7 +1730,8 @@ emulate_bittest(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
 
 static int
 emulate_twob_group15(void *vm, int vcpuid, uint64_t gpa, struct vie *vie,
-    mem_region_read_t memread, mem_region_write_t memwrite, void *memarg)
+    mem_region_read_t memread, mem_region_write_t memwrite __unused,
+    void *memarg)
 {
 	int error;
 	uint64_t buf;
diff --git a/usr.sbin/bhyve/block_if.c b/usr.sbin/bhyve/block_if.c
index 2ca6da0469ac..558a1629f074 100644
--- a/usr.sbin/bhyve/block_if.c
+++ b/usr.sbin/bhyve/block_if.c
@@ -397,7 +397,8 @@ blockif_thr(void *arg)
 }
 
 static void
-blockif_sigcont_handler(int signal, enum ev_type type, void *arg)
+blockif_sigcont_handler(int signal __unused, enum ev_type type __unused,
+    void *arg __unused)
 {
 	struct blockif_sig_elem *bse;
 
@@ -641,7 +642,7 @@ err:
 }
 
 static void
-blockif_resized(int fd, enum ev_type type, void *arg)
+blockif_resized(int fd, enum ev_type type __unused, void *arg)
 {
 	struct blockif_ctxt *bc;
 	struct stat sb;
diff --git a/usr.sbin/bhyve/bootrom.c b/usr.sbin/bhyve/bootrom.c
index 2406d4539e55..b851d39b485c 100644
--- a/usr.sbin/bhyve/bootrom.c
+++ b/usr.sbin/bhyve/bootrom.c
@@ -84,8 +84,9 @@ static struct bootrom_var_state {
  * that the Firmware Volume area is writable and persistent.
  */
 static int
-bootrom_var_mem_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
-    int size, uint64_t *val, void *arg1, long arg2)
+bootrom_var_mem_handler(struct vmctx *ctx __unused, int vcpu __unused, int dir,
+    uint64_t addr, int size, uint64_t *val, void *arg1 __unused,
+    long arg2 __unused)
 {
 	off_t offset;
 
diff --git a/usr.sbin/bhyve/fwctl.c b/usr.sbin/bhyve/fwctl.c
index 7027e34a77f0..b4bfecb2bedd 100644
--- a/usr.sbin/bhyve/fwctl.c
+++ b/usr.sbin/bhyve/fwctl.c
@@ -119,7 +119,7 @@ errop_set(int err)
 }
 
 static int
-errop_start(uint32_t len)
+errop_start(uint32_t len __unused)
 {
 	errop_code = ENOENT;
 
@@ -128,7 +128,7 @@ errop_start(uint32_t len)
 }
 
 static void
-errop_data(uint32_t data, uint32_t len)
+errop_data(uint32_t data __unused, uint32_t len __unused)
 {
 
 	/* ignore */
@@ -144,7 +144,7 @@ errop_result(struct iovec **data)
 }
 
 static void
-errop_done(struct iovec *data)
+errop_done(struct iovec *data __unused)
 {
 
 	/* assert data is NULL */
@@ -200,7 +200,7 @@ fget_start(uint32_t len)
 }
 
 static void
-fget_data(uint32_t data, uint32_t len)
+fget_data(uint32_t data, uint32_t len __unused)
 {
 
 	*((uint32_t *) &fget_str[fget_cnt]) = data;
@@ -244,7 +244,7 @@ fget_result(struct iovec **data, int val)
 }
 
 static void
-fget_done(struct iovec *data)
+fget_done(struct iovec *data __unused)
 {
 
 	/* nothing needs to be freed */
@@ -520,8 +520,8 @@ fwctl_outl(uint32_t val)
 }
 
 static int
-fwctl_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
-    uint32_t *eax, void *arg)
+fwctl_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
+    int port __unused, int bytes, uint32_t *eax, void *arg __unused)
 {
 
 	if (in) {
diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c
index 81f132e17350..cf0d5995a5d3 100644
--- a/usr.sbin/bhyve/gdb.c
+++ b/usr.sbin/bhyve/gdb.c
@@ -1704,7 +1704,7 @@ check_command(int fd)
 }
 
 static void
-gdb_readable(int fd, enum ev_type event, void *arg)
+gdb_readable(int fd, enum ev_type event __unused, void *arg __unused)
 {
 	ssize_t nread;
 	int pending;
@@ -1743,14 +1743,14 @@ gdb_readable(int fd, enum ev_type event, void *arg)
 }
 
 static void
-gdb_writable(int fd, enum ev_type event, void *arg)
+gdb_writable(int fd, enum ev_type event __unused, void *arg __unused)
 {
 
 	send_pending_data(fd);
 }
 
 static void
-new_connection(int fd, enum ev_type event, void *arg)
+new_connection(int fd, enum ev_type event __unused, void *arg)
 {
 	int optval, s;
 
diff --git a/usr.sbin/bhyve/inout.c b/usr.sbin/bhyve/inout.c
index b65d273f4320..02b38c9b7a99 100644
--- a/usr.sbin/bhyve/inout.c
+++ b/usr.sbin/bhyve/inout.c
@@ -66,8 +66,8 @@ static struct {
 } inout_handlers[MAX_IOPORTS];
 
 static int
-default_inout(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
-              uint32_t *eax, void *arg)
+default_inout(struct vmctx *ctx __unused, int vcpu __unused, int in,
+    int port __unused, int bytes, uint32_t *eax, void *arg __unused)
 {
 	if (in) {
 		switch (bytes) {
diff --git a/usr.sbin/bhyve/mevent.c b/usr.sbin/bhyve/mevent.c
index b7749ed67745..8a6267f4acbd 100644
--- a/usr.sbin/bhyve/mevent.c
+++ b/usr.sbin/bhyve/mevent.c
@@ -99,7 +99,7 @@ mevent_qunlock(void)
 }
 
 static void
-mevent_pipe_read(int fd, enum ev_type type, void *param)
+mevent_pipe_read(int fd, enum ev_type type __unused, void *param __unused)
 {
 	char buf[MEVENT_MAX];
 	int status;
diff --git a/usr.sbin/bhyve/mptbl.c b/usr.sbin/bhyve/mptbl.c
index 56582256a857..6e3f78a22888 100644
--- a/usr.sbin/bhyve/mptbl.c
+++ b/usr.sbin/bhyve/mptbl.c
@@ -213,8 +213,8 @@ mpt_count_ioint_entries(void)
 }
 
 static void
-mpt_generate_pci_int(int bus, int slot, int pin, int pirq_pin, int ioapic_irq,
-    void *arg)
+mpt_generate_pci_int(int bus, int slot, int pin, int pirq_pin __unused,
+    int ioapic_irq, void *arg)
 {
 	int_entry_ptr *mpiep, mpie;
 
diff --git a/usr.sbin/bhyve/net_backends.c b/usr.sbin/bhyve/net_backends.c
index 8440b801ce6a..6fb04fddc857 100644
--- a/usr.sbin/bhyve/net_backends.c
+++ b/usr.sbin/bhyve/net_backends.c
@@ -222,7 +222,7 @@ tap_cleanup(struct net_backend *be)
 
 static int
 tap_init(struct net_backend *be, const char *devname,
-	 nvlist_t *nvl, net_be_rxeof_t cb, void *param)
+    nvlist_t *nvl __unused, net_be_rxeof_t cb, void *param)
 {
 	struct tap_priv *priv = NET_BE_PRIV(be);
 	char tbuf[80];
@@ -397,15 +397,15 @@ tap_recv_disable(struct net_backend *be)
 }
 
 static uint64_t
-tap_get_cap(struct net_backend *be)
+tap_get_cap(struct net_backend *be __unused)
 {
 
 	return (0); /* no capabilities for now */
 }
 
 static int
-tap_set_cap(struct net_backend *be, uint64_t features,
-		unsigned vnet_hdr_len)
+tap_set_cap(struct net_backend *be __unused, uint64_t features,
+    unsigned vnet_hdr_len)
 {
 
 	return ((features || vnet_hdr_len) ? -1 : 0);
@@ -452,7 +452,7 @@ DATA_SET(net_backend_set, vmnet_backend);
 #define NG_SBUF_MAX_SIZE (4 * 1024 * 1024)
 
 static int
-ng_init(struct net_backend *be, const char *devname,
+ng_init(struct net_backend *be, const char *devname __unused,
 	 nvlist_t *nvl, net_be_rxeof_t cb, void *param)
 {
 	struct tap_priv *p = NET_BE_PRIV(be);
@@ -677,8 +677,8 @@ netmap_get_cap(struct net_backend *be)
 }
 
 static int
-netmap_set_cap(struct net_backend *be, uint64_t features,
-	       unsigned vnet_hdr_len)
+netmap_set_cap(struct net_backend *be, uint64_t features __unused,
+    unsigned vnet_hdr_len)
 {
 
 	return (netmap_set_vnet_hdr_len(be, vnet_hdr_len));
@@ -686,7 +686,7 @@ netmap_set_cap(struct net_backend *be, uint64_t features,
 
 static int
 netmap_init(struct net_backend *be, const char *devname,
-	    nvlist_t *nvl, net_be_rxeof_t cb, void *param)
+    nvlist_t *nvl __unused, net_be_rxeof_t cb, void *param)
 {
 	struct netmap_priv *priv = NET_BE_PRIV(be);
 
diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c
index 94bf553d7590..d4000b7a63c6 100644
--- a/usr.sbin/bhyve/pci_ahci.c
+++ b/usr.sbin/bhyve/pci_ahci.c
@@ -2189,8 +2189,9 @@ pci_ahci_host_write(struct pci_ahci_softc *sc, uint64_t offset, uint64_t value)
 }
 
 static void
-pci_ahci_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-		int baridx, uint64_t offset, int size, uint64_t value)
+pci_ahci_write(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size,
+    uint64_t value)
 {
 	struct pci_ahci_softc *sc = pi->pi_arg;
 
@@ -2283,8 +2284,8 @@ pci_ahci_port_read(struct pci_ahci_softc *sc, uint64_t offset)
 }
 
 static uint64_t
-pci_ahci_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
-    uint64_t regoff, int size)
+pci_ahci_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t regoff, int size)
 {
 	struct pci_ahci_softc *sc = pi->pi_arg;
 	uint64_t offset;
@@ -2411,7 +2412,7 @@ pci_ahci_hd_legacy_config(nvlist_t *nvl, const char *opts)
 }
 
 static int
-pci_ahci_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
+pci_ahci_init(struct vmctx *ctx __unused, struct pci_devinst *pi, nvlist_t *nvl)
 {
 	char bident[sizeof("XX:XX:XX")];
 	char node_name[sizeof("XX")];
@@ -2659,7 +2660,7 @@ done:
 }
 
 static int
-pci_ahci_pause(struct vmctx *ctx, struct pci_devinst *pi)
+pci_ahci_pause(struct vmctx *ctx __unused, struct pci_devinst *pi)
 {
 	struct pci_ahci_softc *sc;
 	struct blockif_ctxt *bctxt;
@@ -2679,7 +2680,7 @@ pci_ahci_pause(struct vmctx *ctx, struct pci_devinst *pi)
 }
 
 static int
-pci_ahci_resume(struct vmctx *ctx, struct pci_devinst *pi)
+pci_ahci_resume(struct vmctx *ctx __unused, struct pci_devinst *pi)
 {
 	struct pci_ahci_softc *sc;
 	struct blockif_ctxt *bctxt;
diff --git a/usr.sbin/bhyve/pci_e82545.c b/usr.sbin/bhyve/pci_e82545.c
index a38edef72e20..8785935dafc8 100644
--- a/usr.sbin/bhyve/pci_e82545.c
+++ b/usr.sbin/bhyve/pci_e82545.c
@@ -407,15 +407,15 @@ e82545_init_eeprom(struct e82545_softc *sc)
 }
 
 static void
-e82545_write_mdi(struct e82545_softc *sc, uint8_t reg_addr,
-			uint8_t phy_addr, uint32_t data)
+e82545_write_mdi(struct e82545_softc *sc __unused, uint8_t reg_addr,
+    uint8_t phy_addr, uint32_t data)
 {
 	DPRINTF("Write mdi reg:0x%x phy:0x%x data: 0x%x", reg_addr, phy_addr, data);
 }
 
 static uint32_t
-e82545_read_mdi(struct e82545_softc *sc, uint8_t reg_addr,
-			uint8_t phy_addr)
+e82545_read_mdi(struct e82545_softc *sc __unused, uint8_t reg_addr,
+    uint8_t phy_addr)
 {
 	//DPRINTF("Read mdi reg:0x%x phy:0x%x", reg_addr, phy_addr);
 	switch (reg_addr) {
@@ -554,7 +554,7 @@ e82545_eecd_strobe(struct e82545_softc *sc)
 }
 
 static void
-e82545_itr_callback(int fd, enum ev_type type, void *param)
+e82545_itr_callback(int fd __unused, enum ev_type type __unused, void *param)
 {
 	uint32_t new;
 	struct e82545_softc *sc = param;
@@ -830,7 +830,7 @@ e82545_bufsz(uint32_t rctl)
 
 /* XXX one packet at a time until this is debugged */
 static void
-e82545_rx_callback(int fd, enum ev_type type, void *param)
+e82545_rx_callback(int fd __unused, enum ev_type type __unused, void *param)
 {
 	struct e82545_softc *sc = param;
 	struct e1000_rx_desc *rxd;
@@ -2111,8 +2111,9 @@ e82545_read_register(struct e82545_softc *sc, uint32_t offset)
 }
 
 static void
-e82545_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
-	     uint64_t offset, int size, uint64_t value)
+e82545_write(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size,
+    uint64_t value)
 {
 	struct e82545_softc *sc;
 
@@ -2161,8 +2162,8 @@ e82545_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
 }
 
 static uint64_t
-e82545_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
-	    uint64_t offset, int size)
+e82545_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size)
 {
 	struct e82545_softc *sc;
 	uint64_t retval;
diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c
index 3d3fc80c6293..2087c6597852 100644
--- a/usr.sbin/bhyve/pci_emul.c
+++ b/usr.sbin/bhyve/pci_emul.c
@@ -1162,9 +1162,9 @@ msicap_cfgwrite(struct pci_devinst *pi, int capoff, int offset,
 	pci_lintr_update(pi);
 }
 
-void
-pciecap_cfgwrite(struct pci_devinst *pi, int capoff, int offset,
-		 int bytes, uint32_t val)
+static void
+pciecap_cfgwrite(struct pci_devinst *pi, int capoff __unused, int offset,
+    int bytes, uint32_t val)
 {
 
 	/* XXX don't write to the readonly parts */
@@ -1275,8 +1275,9 @@ pci_emul_iscap(struct pci_devinst *pi, int offset)
 }
 
 static int
-pci_emul_fallback_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
-			  int size, uint64_t *val, void *arg1, long arg2)
+pci_emul_fallback_handler(struct vmctx *ctx __unused, int vcpu __unused,
+    int dir, uint64_t addr __unused, int size __unused, uint64_t *val,
+    void *arg1 __unused, long arg2 __unused)
 {
 	/*
 	 * Ignore writes; return 0xff's for reads. The mem read code
@@ -1291,7 +1292,7 @@ pci_emul_fallback_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
 
 static int
 pci_emul_ecfg_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr,
-    int bytes, uint64_t *val, void *arg1, long arg2)
+    int bytes, uint64_t *val, void *arg1 __unused, long arg2 __unused)
 {
 	int bus, slot, func, coff, in;
 
@@ -1487,8 +1488,8 @@ init_pci(struct vmctx *ctx)
 }
 
 static void
-pci_apic_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq,
-    void *arg)
+pci_apic_prt_entry(int bus __unused, int slot, int pin, int pirq_pin __unused,
+    int ioapic_irq, void *arg __unused)
 {
 
 	dsdt_line("  Package ()");
@@ -1501,8 +1502,8 @@ pci_apic_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq,
 }
 
 static void
-pci_pirq_prt_entry(int bus, int slot, int pin, int pirq_pin, int ioapic_irq,
-    void *arg)
+pci_pirq_prt_entry(int bus __unused, int slot, int pin, int pirq_pin,
+    int ioapic_irq __unused, void *arg __unused)
 {
 	char *name;
 
@@ -2213,8 +2214,8 @@ pci_cfgrw(struct vmctx *ctx, int vcpu, int in, int bus, int slot, int func,
 static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff;
 
 static int
-pci_emul_cfgaddr(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
-		 uint32_t *eax, void *arg)
+pci_emul_cfgaddr(struct vmctx *ctx __unused, int vcpu __unused, int in,
+    int port __unused, int bytes, uint32_t *eax, void *arg __unused)
 {
 	uint32_t x;
 
@@ -2244,7 +2245,7 @@ INOUT_PORT(pci_cfgaddr, CONF1_ADDR_PORT, IOPORT_F_INOUT, pci_emul_cfgaddr);
 
 static int
 pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
-		 uint32_t *eax, void *arg)
+    uint32_t *eax, void *arg __unused)
 {
 	int coff;
 
@@ -2465,7 +2466,8 @@ struct pci_emul_dsoftc {
 #define	PCI_EMUL_MSIX_MSGS	16
 
 static int
-pci_emul_dinit(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
+pci_emul_dinit(struct vmctx *ctx __unused, struct pci_devinst *pi,
+    nvlist_t *nvl __unused)
 {
 	int error;
 	struct pci_emul_dsoftc *sc;
@@ -2494,8 +2496,9 @@ pci_emul_dinit(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
 }
 
 static void
-pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
-	      uint64_t offset, int size, uint64_t value)
+pci_emul_diow(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size,
+    uint64_t value)
 {
 	int i;
 	struct pci_emul_dsoftc *sc = pi->pi_arg;
@@ -2561,8 +2564,8 @@ pci_emul_diow(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
 }
 
 static uint64_t
-pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
-	      uint64_t offset, int size)
+pci_emul_dior(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size)
 {
 	struct pci_emul_dsoftc *sc = pi->pi_arg;
 	uint32_t value;
@@ -2620,9 +2623,8 @@ pci_emul_dior(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
 
 #ifdef BHYVE_SNAPSHOT
 int
-pci_emul_snapshot(struct vm_snapshot_meta *meta)
+pci_emul_snapshot(struct vm_snapshot_meta *meta __unused)
 {
-
 	return (0);
 }
 #endif
diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c
index e772f29770e6..43b53931f14c 100644
--- a/usr.sbin/bhyve/pci_fbuf.c
+++ b/usr.sbin/bhyve/pci_fbuf.c
@@ -117,8 +117,9 @@ static struct pci_fbuf_softc *fbuf_sc;
 #define	PCI_FBUF_MSI_MSGS	 4
 
 static void
-pci_fbuf_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-	       int baridx, uint64_t offset, int size, uint64_t value)
+pci_fbuf_write(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size,
+    uint64_t value)
 {
 	struct pci_fbuf_softc *sc;
 	uint8_t *p;
@@ -171,8 +172,8 @@ pci_fbuf_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
 }
 
 static uint64_t
-pci_fbuf_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-	      int baridx, uint64_t offset, int size)
+pci_fbuf_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size)
 {
 	struct pci_fbuf_softc *sc;
 	uint8_t *p;
diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c
index 1a2a3844ab20..9ebfbfbaa5bf 100644
--- a/usr.sbin/bhyve/pci_hda.c
+++ b/usr.sbin/bhyve/pci_hda.c
@@ -890,7 +890,7 @@ hda_get_offset_stream(uint8_t stream_ind)
 }
 
 static void
-hda_set_gctl(struct hda_softc *sc, uint32_t offset, uint32_t old)
+hda_set_gctl(struct hda_softc *sc, uint32_t offset, uint32_t old __unused)
 {
 	uint32_t value = hda_get_reg_by_offset(sc, offset);
 
@@ -913,7 +913,8 @@ hda_set_statests(struct hda_softc *sc, uint32_t offset, uint32_t old)
 }
 
 static void
-hda_set_corbwp(struct hda_softc *sc, uint32_t offset, uint32_t old)
+hda_set_corbwp(struct hda_softc *sc, uint32_t offset __unused,
+    uint32_t old __unused)
 {
 	hda_corb_run(sc);
 }
@@ -939,7 +940,7 @@ hda_set_corbctl(struct hda_softc *sc, uint32_t offset, uint32_t old)
 }
 
 static void
-hda_set_rirbctl(struct hda_softc *sc, uint32_t offset, uint32_t old)
+hda_set_rirbctl(struct hda_softc *sc, uint32_t offset, uint32_t old __unused)
 {
 	uint32_t value = hda_get_reg_by_offset(sc, offset);
 	int err;
@@ -1025,7 +1026,7 @@ hda_set_sdctl(struct hda_softc *sc, uint32_t offset, uint32_t old)
 }
 
 static void
-hda_set_sdctl2(struct hda_softc *sc, uint32_t offset, uint32_t old)
+hda_set_sdctl2(struct hda_softc *sc, uint32_t offset, uint32_t old __unused)
 {
 	uint32_t value = hda_get_reg_by_offset(sc, offset);
 
@@ -1256,8 +1257,9 @@ pci_hda_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
 }
 
 static void
-pci_hda_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-    int baridx, uint64_t offset, int size, uint64_t value)
+pci_hda_write(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size,
+    uint64_t value)
 {
 	struct hda_softc *sc = pi->pi_arg;
 	int err;
@@ -1273,8 +1275,8 @@ pci_hda_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
 }
 
 static uint64_t
-pci_hda_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-    int baridx, uint64_t offset, int size)
+pci_hda_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size)
 {
 	struct hda_softc *sc = pi->pi_arg;
 	uint64_t value = 0;
diff --git a/usr.sbin/bhyve/pci_hostbridge.c b/usr.sbin/bhyve/pci_hostbridge.c
index 44649715ff88..50c334d8e408 100644
--- a/usr.sbin/bhyve/pci_hostbridge.c
+++ b/usr.sbin/bhyve/pci_hostbridge.c
@@ -37,7 +37,8 @@ __FBSDID("$FreeBSD$");
 #include "pci_emul.h"
 
 static int
-pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
+pci_hostbridge_init(struct vmctx *ctx __unused, struct pci_devinst *pi,
+    nvlist_t *nvl)
 {
 	const char *value;
 	u_int vendor, device;
@@ -65,9 +66,8 @@ pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
 }
 
 static int
-pci_amd_hostbridge_legacy_config(nvlist_t *nvl, const char *opts)
+pci_amd_hostbridge_legacy_config(nvlist_t *nvl, const char *opts __unused)
 {
-
 	set_config_value_node(nvl, "vendor", "0x1022");	/* AMD */
 	set_config_value_node(nvl, "devid", "0x7432");	/* made up */
 
diff --git a/usr.sbin/bhyve/pci_irq.c b/usr.sbin/bhyve/pci_irq.c
index 4ecb3eddb07f..ff41f6ec88dc 100644
--- a/usr.sbin/bhyve/pci_irq.c
+++ b/usr.sbin/bhyve/pci_irq.c
@@ -134,7 +134,7 @@ pci_irq_use(int irq)
 }
 
 void
-pci_irq_init(struct vmctx *ctx)
+pci_irq_init(struct vmctx *ctx __unused)
 {
 	int i;
 
diff --git a/usr.sbin/bhyve/pci_lpc.c b/usr.sbin/bhyve/pci_lpc.c
index 35f93ded68ec..5425a7935973 100644
--- a/usr.sbin/bhyve/pci_lpc.c
+++ b/usr.sbin/bhyve/pci_lpc.c
@@ -171,7 +171,7 @@ lpc_uart_intr_assert(void *arg)
 }
 
 static void
-lpc_uart_intr_deassert(void *arg)
+lpc_uart_intr_deassert(void *arg __unused)
 {
 	/*
 	 * The COM devices on the LPC bus generate edge triggered interrupts,
@@ -180,8 +180,8 @@ lpc_uart_intr_deassert(void *arg)
 }
 
 static int
-lpc_uart_io_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
-		    uint32_t *eax, void *arg)
+lpc_uart_io_handler(struct vmctx *ctx __unused, int vcpu __unused, int in,
+    int port, int bytes, uint32_t *eax, void *arg)
 {
 	int offset;
 	struct lpc_uart_softc *sc = arg;
@@ -398,8 +398,8 @@ pci_lpc_uart_dsdt(void)
 LPC_DSDT(pci_lpc_uart_dsdt);
 
 static int
-pci_lpc_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-		  int coff, int bytes, uint32_t val)
+pci_lpc_cfgwrite(struct vmctx *ctx, int vcpu __unused, struct pci_devinst *pi,
+    int coff, int bytes, uint32_t val)
 {
 	int pirq_pin;
 
@@ -419,14 +419,16 @@ pci_lpc_cfgwrite(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
 }
 
 static void
-pci_lpc_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-	       int baridx, uint64_t offset, int size, uint64_t value)
+pci_lpc_write(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi __unused, int baridx __unused,
+    uint64_t offset __unused, int size __unused, uint64_t value __unused)
 {
 }
 
 static uint64_t
-pci_lpc_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-	      int baridx, uint64_t offset, int size)
+pci_lpc_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi __unused, int baridx __unused, uint64_t offset __unused,
+    int size __unused)
 {
 	return (0);
 }
@@ -435,9 +437,8 @@ pci_lpc_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
 #define	LPC_VENDOR	0x8086
 
 static int
-pci_lpc_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
+pci_lpc_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl __unused)
 {
-
 	/*
 	 * Do not allow more than one LPC bridge to be configured.
 	 */
diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
index 5d9e6c07c245..6c9b1de304a9 100644
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -454,7 +454,7 @@ msix_table_write(struct vmctx *ctx, int vcpu, struct passthru_softc *sc,
 }
 
 static int
-init_msix_table(struct vmctx *ctx, struct passthru_softc *sc)
+init_msix_table(struct vmctx *ctx __unused, struct passthru_softc *sc)
 {
 	struct pci_devinst *pi = sc->psc_pi;
 	struct pci_bar_mmap pbm;
@@ -515,7 +515,7 @@ init_msix_table(struct vmctx *ctx, struct passthru_softc *sc)
 }
 
 static int
-cfginitbar(struct vmctx *ctx, struct passthru_softc *sc)
+cfginitbar(struct vmctx *ctx __unused, struct passthru_softc *sc)
 {
 	int i, error;
 	struct pci_devinst *pi;
@@ -689,8 +689,8 @@ passthru_legacy_config(nvlist_t *nvl, const char *opts)
 }
 
 static int
-passthru_init_rom(struct vmctx *const ctx, struct passthru_softc *const sc,
-    const char *const romfile)
+passthru_init_rom(struct vmctx *const ctx __unused,
+    struct passthru_softc *const sc, const char *const romfile)
 {
 	if (romfile == NULL) {
 		return (0);
@@ -910,8 +910,8 @@ msixcap_access(struct passthru_softc *sc, int coff)
 }
 
 static int
-passthru_cfgread(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-		 int coff, int bytes, uint32_t *rv)
+passthru_cfgread(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int coff, int bytes, uint32_t *rv)
 {
 	struct passthru_softc *sc;
 
@@ -1064,8 +1064,8 @@ passthru_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
 }
 
 static uint64_t
-passthru_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi, int baridx,
-	      uint64_t offset, int size)
+passthru_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size)
 {
 	struct passthru_softc *sc;
 	struct pci_bar_ioreq pio;
diff --git a/usr.sbin/bhyve/pci_uart.c b/usr.sbin/bhyve/pci_uart.c
index 3064d6fe627a..2e4a0eac05f9 100644
--- a/usr.sbin/bhyve/pci_uart.c
+++ b/usr.sbin/bhyve/pci_uart.c
@@ -66,19 +66,19 @@ pci_uart_intr_deassert(void *arg)
 }
 
 static void
-pci_uart_write(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-	       int baridx, uint64_t offset, int size, uint64_t value)
+pci_uart_write(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size,
+    uint64_t value)
 {
-
 	assert(baridx == 0);
 	assert(size == 1);
 
 	uart_write(pi->pi_arg, offset, value);
 }
 
-uint64_t
-pci_uart_read(struct vmctx *ctx, int vcpu, struct pci_devinst *pi,
-	      int baridx, uint64_t offset, int size)
+static uint64_t
+pci_uart_read(struct vmctx *ctx __unused, int vcpu __unused,
+    struct pci_devinst *pi, int baridx, uint64_t offset, int size)
 {
 	uint8_t val;
 
@@ -99,7 +99,7 @@ pci_uart_legacy_config(nvlist_t *nvl, const char *opts)
 }
 
 static int
-pci_uart_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
+pci_uart_init(struct vmctx *ctx __unused, struct pci_devinst *pi, nvlist_t *nvl)
 {
 	struct uart_softc *sc;
 	const char *device;
diff --git a/usr.sbin/bhyve/pci_virtio_9p.c b/usr.sbin/bhyve/pci_virtio_9p.c
index 1ed0eba6a8ed..c24b33acc299 100644
--- a/usr.sbin/bhyve/pci_virtio_9p.c
+++ b/usr.sbin/bhyve/pci_virtio_9p.c
@@ -147,7 +147,7 @@ pci_vt9p_cfgread(void *vsc, int offset, int size, uint32_t *retval)
 
 static int
 pci_vt9p_get_buffer(struct l9p_request *req, struct iovec *iov, size_t *niov,
-    void *arg)
+    void *arg __unused)
 {
 	struct pci_vt9p_request *preq = req->lr_aux;
 	size_t n = preq->vsr_niov - preq->vsr_respidx;
@@ -159,8 +159,8 @@ pci_vt9p_get_buffer(struct l9p_request *req, struct iovec *iov, size_t *niov,
 }
 
 static int
-pci_vt9p_send(struct l9p_request *req, const struct iovec *iov,
-    const size_t niov, const size_t iolen, void *arg)
+pci_vt9p_send(struct l9p_request *req, const struct iovec *iov __unused,
+    const size_t niov __unused, const size_t iolen, void *arg __unused)
 {
 	struct pci_vt9p_request *preq = req->lr_aux;
 	struct pci_vt9p_softc *sc = preq->vsr_sc;
@@ -176,8 +176,8 @@ pci_vt9p_send(struct l9p_request *req, const struct iovec *iov,
 }
 
 static void
-pci_vt9p_drop(struct l9p_request *req, const struct iovec *iov, size_t niov,
-    void *arg)
+pci_vt9p_drop(struct l9p_request *req, const struct iovec *iov __unused,
+    size_t niov __unused, void *arg __unused)
 {
 	struct pci_vt9p_request *preq = req->lr_aux;
 	struct pci_vt9p_softc *sc = preq->vsr_sc;
@@ -248,7 +248,7 @@ pci_vt9p_legacy_config(nvlist_t *nvl, const char *opts)
 }
 
 static int
-pci_vt9p_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
+pci_vt9p_init(struct vmctx *ctx __unused, struct pci_devinst *pi, nvlist_t *nvl)
 {
 	struct pci_vt9p_softc *sc;
 	const char *value;
diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c
index 8cdcbb777691..2b2e6a412a5a 100644
--- a/usr.sbin/bhyve/pci_virtio_block.c
+++ b/usr.sbin/bhyve/pci_virtio_block.c
@@ -437,7 +437,8 @@ pci_vtblk_notify(void *vsc, struct vqueue_info *vq)
 }
 
 static void
-pci_vtblk_resized(struct blockif_ctxt *bctxt, void *arg, size_t new_size)
+pci_vtblk_resized(struct blockif_ctxt *bctxt __unused, void *arg,
+    size_t new_size)
 {
*** 659 LINES SKIPPED ***