From 03d3124629e886e4721550a659a032b129ee0347 Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Mon, 3 Apr 2023 12:45:11 +0200 Subject: [PATCH] bhyve: Disable bhyve HDA debug by default. Adapt hda_print_cmd_ctl_data() to not generate compiler warnings when DEBUG_HDA is off. Reviewed by: corvink Approved by: corvink Differential Revision: https://reviews.freebsd.org/D39826 --- usr.sbin/bhyve/pci_hda.c | 16 +++++++++------- usr.sbin/bhyve/pci_hda.h | 1 - 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c index 9e9d7ab5a626..07b0e745b0b9 100644 --- a/usr.sbin/bhyve/pci_hda.c +++ b/usr.sbin/bhyve/pci_hda.c @@ -726,17 +726,19 @@ hda_write(struct hda_softc *sc, uint32_t offset, uint8_t size, uint32_t value) return (0); } +#if DEBUG_HDA == 1 static inline void hda_print_cmd_ctl_data(struct hda_codec_cmd_ctl *p) { -#if DEBUG_HDA == 1 - const char *name = p->name; -#endif - DPRINTF("%s size: %d", name, p->size); - DPRINTF("%s dma_vaddr: %p", name, p->dma_vaddr); - DPRINTF("%s wp: 0x%x", name, p->wp); - DPRINTF("%s rp: 0x%x", name, p->rp); + DPRINTF("%s size: %d", p->name, p->size); + DPRINTF("%s dma_vaddr: %p", p->name, p->dma_vaddr); + DPRINTF("%s wp: 0x%x", p->name, p->wp); + DPRINTF("%s rp: 0x%x", p->name, p->rp); } +#else +static inline void +hda_print_cmd_ctl_data(struct hda_codec_cmd_ctl *p __unused) {} +#endif static int hda_corb_start(struct hda_softc *sc) diff --git a/usr.sbin/bhyve/pci_hda.h b/usr.sbin/bhyve/pci_hda.h index 12d80a92f60a..8b24afac4771 100644 --- a/usr.sbin/bhyve/pci_hda.h +++ b/usr.sbin/bhyve/pci_hda.h @@ -46,7 +46,6 @@ /* * HDA Debug Log */ -#define DEBUG_HDA 1 #if DEBUG_HDA == 1 extern FILE *dbg; #define DPRINTF(fmt, arg...) \