Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jul 2022 19:18:05 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 3e4582f80355 - stable/13 - Fix unused variable warning in mlx5_ib_devx.c
Message-ID:  <202207271918.26RJI5ba058731@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dim:

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

commit 3e4582f80355735a80370e264d07f9caff9f5d30
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-07-24 22:22:05 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-07-27 19:17:13 +0000

    Fix unused variable warning in mlx5_ib_devx.c
    
    With clang 15, the following -Werror warning is produced:
    
        sys/dev/mthca/mthca_cmd.c:662:23: error: variable 'tc' set but not used [-Werror,-Wunused-but-set-variable]
                int ts __unused = 0, tc = 0;
                                     ^
    
    The 'ts' and 'tc' variables are eventually used only in mthca_dbg()
    macros, if CONFIG_INFINIBAND_MTHCA_DEBUG is defined. Ensure 'ts' and
    'tc' are only declared and used when CONFIG_INFINIBAND_MTHCA_DEBUG is
    defined.
    
    MFC after:      3 days
    
    (cherry picked from commit 5ae3710aeb2a984344fbe36de71612fc1a3d1a71)
---
 sys/dev/mthca/mthca_cmd.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sys/dev/mthca/mthca_cmd.c b/sys/dev/mthca/mthca_cmd.c
index b4c0dc2f6f1d..6924348e72e4 100644
--- a/sys/dev/mthca/mthca_cmd.c
+++ b/sys/dev/mthca/mthca_cmd.c
@@ -659,7 +659,9 @@ static int mthca_map_cmd(struct mthca_dev *dev, u16 op, struct mthca_icm *icm,
 	int nent = 0;
 	int i;
 	int err = 0;
+#ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
 	int ts = 0, tc = 0;
+#endif /* CONFIG_INFINIBAND_MTHCA_DEBUG */
 
 	mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL);
 	if (IS_ERR(mailbox))
@@ -693,8 +695,10 @@ static int mthca_map_cmd(struct mthca_dev *dev, u16 op, struct mthca_icm *icm,
 			pages[nent * 2 + 1] =
 				cpu_to_be64((mthca_icm_addr(&iter) + (i << lg)) |
 					    (lg - MTHCA_ICM_PAGE_SHIFT));
+#ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
 			ts += 1 << (lg - 10);
 			++tc;
+#endif /* CONFIG_INFINIBAND_MTHCA_DEBUG */
 
 			if (++nent == MTHCA_MAILBOX_SIZE / 16) {
 				err = mthca_cmd(dev, mailbox->dma, nent, 0, op,



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