git: 748fa70c5d12 - stable/14 - qlxgbe: fix debug prints in ql_os.c

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Fri, 07 Jun 2024 05:49:43 UTC
The branch stable/14 has been updated by kbowling:

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

commit 748fa70c5d12d163e496d033bfd0a5e5919f2df9
Author:     Fuqian Huang <huangfq.daxian@gmail.com>
AuthorDate: 2024-05-28 05:31:03 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2024-06-07 05:47:32 +0000

    qlxgbe: fix debug prints in ql_os.c
    
    QL_DPRINT2 checks the debug level first and then prints.
    Replace device_printf with QL_DPRINT2 to check debug level
    first before printing out the kernel pointers.
    
    PR:             238655
    
    (cherry picked from commit 3d6c7ee87e9d7f3c8f617c3803af3effa8eb8a16)
---
 sys/dev/qlxgbe/ql_os.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sys/dev/qlxgbe/ql_os.c b/sys/dev/qlxgbe/ql_os.c
index d20e7a103d02..0b3b2ca7954f 100644
--- a/sys/dev/qlxgbe/ql_os.c
+++ b/sys/dev/qlxgbe/ql_os.c
@@ -322,7 +322,7 @@ static int
 qla_pci_attach(device_t dev)
 {
 	qla_host_t *ha = NULL;
-	uint32_t rsrc_len;
+	uint32_t rsrc_len __unused;
 	int i;
 	uint32_t num_rcvq = 0;
 
@@ -405,10 +405,10 @@ qla_pci_attach(device_t dev)
                         __func__);
                 goto qla_pci_attach_err;
         }
-        device_printf(dev, "%s: ha %p pci_func 0x%x rsrc_count 0x%08x"
+        QL_DPRINT2(ha, (dev, "%s: ha %p pci_func 0x%x rsrc_count 0x%08x"
                 " msix_count 0x%x pci_reg %p pci_reg1 %p num_rcvq = %d\n",
 		__func__, ha, ha->pci_func, rsrc_len, ha->msix_count,
-		ha->pci_reg, ha->pci_reg1, num_rcvq);
+		ha->pci_reg, ha->pci_reg1, num_rcvq));
 
         if ((ha->msix_count  < 64) || (num_rcvq != 32)) {
 		if (ha->hw.num_sds_rings > 15) {
@@ -1274,9 +1274,9 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32_t txr_idx,
 			"mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\
 			ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head));
 
-		device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d "
+		QL_DPRINT2(ha, (ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d "
 			"mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,
-			ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head);
+			ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head));
 
 		if (m_head)
 			m_freem(m_head);