From nobody Sun Jul 24 22:40:45 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4LrdRy14tzz3ysRk; Sun, 24 Jul 2022 22:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LrdRy0bL2z3w2f; Sun, 24 Jul 2022 22:40:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658702446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qhQpLJCWz0Izk2G5+Mh2lVGIaPd3USaGIvlUYs+yFEo=; b=CdRTOuuwsT+1mr+Pq2rNWoIJ+NqQGWfPrVl3892562A6FLM/DXSErgFl3xklAqf96hwaDg L1oo3iB4YkJjoJHd3grwbfqGaf8NvIYBlQUBrcddeun/rPWB8G/xmhAzlGQj2lq3anYZXg 71wtIVHwjtJjjlVzP/w6Gk1Vkfo5a78I4iyL1lip7Bx1HVHkqoyUG0GPKJHX/JDYC9Hai9 7mDHd7CPbkOhJV5GUmMSCwVdlIN+9IclPMF0SJ1c2xRAJ+t8saZSIkVvYo2bvOmdhHz7kG CeX839Eow47zl7Vt7YnhKFAZ6BBmPUIVQKuU4VlMn9wqGLi6Nj4K0Qqn+P4G+A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LrdRx6p0Tzb6r; Sun, 24 Jul 2022 22:40:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26OMejv6086445; Sun, 24 Jul 2022 22:40:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26OMejGL086444; Sun, 24 Jul 2022 22:40:45 GMT (envelope-from git) Date: Sun, 24 Jul 2022 22:40:45 GMT Message-Id: <202207242240.26OMejGL086444@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 5ae3710aeb2a - main - Fix unused variable warning in mlx5_ib_devx.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ae3710aeb2a984344fbe36de71612fc1a3d1a71 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658702446; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qhQpLJCWz0Izk2G5+Mh2lVGIaPd3USaGIvlUYs+yFEo=; b=e3NThz9+cN002tj+VyXjwZLZjBg3BFCChnw1uzjK1DZwxLQCgbp5OOuQE8mgZzNgCO6SSy DrbBk3s/1cuSGulN+2Fyid6UUg4dl9W0v9ompgBQZdPPAYzdQUqdxqvFPwpy8EiLoEvX5z fuGjelzYnC/IDHLBqCrKWqHsPX2SkKliOIEmVhNJuL6xjv5Vp8uW94nZnT/9IbAidxiMu4 FiVsZJ7kGnaPRwsJcAPFBf7rHi0MlNk3Z0f0GW2m8e4cCz2/3E9rgGY6X75hCGpbpHgJYx JhL9nAfYlgYtvS+QAGAIa96EQZo76Ja6UMqavNvm3dXMFGpvQBVFD1zF2kwJqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658702446; a=rsa-sha256; cv=none; b=Oj4cLXLpxpQzBXrMqI83mipUlBSi40V5pJiX2plLKQxdm8Mq9pJwspjsqJ+gOrgrKktCkS TSKRJF9MIf28yi/GU8jOdhmXJbJlmTesjUgmpSRZ7Bza+Nzbg3jWE+A3ZFMT/QgPnnGMGe 9sN8K2KDhbSdaZw9ux6pI3qJKIqAJmQ1g4hP8JOF3gsdcjnWogScFjbUDaf9H7tU4CyD6A RnAO2Vesl96yWqAWWs7264udwEb/2uw6RpVrV7q6Dav0pfcLmmvQ69UggUiuCbhIDnEdod xoicEvD0oigmoDW0jyjy5ob+HaHPstH0Mp0iQTs7TL3CmuhQ2y3YYUU3HjGsYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=5ae3710aeb2a984344fbe36de71612fc1a3d1a71 commit 5ae3710aeb2a984344fbe36de71612fc1a3d1a71 Author: Dimitry Andric AuthorDate: 2022-07-24 22:22:05 +0000 Commit: Dimitry Andric CommitDate: 2022-07-24 22:40: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 --- sys/dev/mthca/mthca_cmd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/mthca/mthca_cmd.c b/sys/dev/mthca/mthca_cmd.c index 8dcce01c061a..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; - int ts __unused = 0, tc = 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,