Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2023 13:13:25 GMT
From:      Guido Falsi <madpilot@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 03d3124629e8 - main - bhyve: Disable bhyve HDA debug by default.
Message-ID:  <202304271313.33RDDP67062439@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by madpilot:

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

commit 03d3124629e886e4721550a659a032b129ee0347
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-04-03 10:45:11 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-04-27 13:12:45 +0000

    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...)						\



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304271313.33RDDP67062439>