From nobody Sun Jul 24 22:40:35 2022 X-Original-To: dev-commits-src-main@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 4LrdRl6g7pz3ysLv; Sun, 24 Jul 2022 22:40:35 +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 4LrdRl6Dv7z3vP8; Sun, 24 Jul 2022 22:40:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658702435; 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=bxwxOOD5yhDQL/GvIznRg2c3JH4C9ODYd6832LB4U+0=; b=VaS/vQh8v0yIWRiNOOPONjM87IUZQuM0aFDNUx2QqWOU1N90f4E6EKfJkG8Y3u4mdxO6We 35of4ZCvqkjXVTJuKmBK3IbZAreUMzhG0DdD0YRdfHRijaeqeevE0x1tVmtELeMoRLgUt2 AypDOlCcwirz9pRFQE42VencGi1WPcGSh9PYPVhUCDpogoJO0aeKPPF5dBaTdPX0sMZlt6 Z2lrIYyg7NkwwSkHugSipSf5hfKA6Hd4ytc0nEKYhpxhCt1K35+5Oox+7G7nyHlA1XCCEl 1DnM5p+Qg+b6PebCvlvqq3ypH3eqMIP3pqbbzlVRWAikK2IQVmgcZujk51JjrA== 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 4LrdRl5HyDzZjf; Sun, 24 Jul 2022 22:40:35 +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 26OMeZnF085459; Sun, 24 Jul 2022 22:40:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26OMeZVM085458; Sun, 24 Jul 2022 22:40:35 GMT (envelope-from git) Date: Sun, 24 Jul 2022 22:40:35 GMT Message-Id: <202207242240.26OMeZVM085458@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: f4f847018048 - main - Fix unused variable warning in icl_soft.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: f4f847018048ac7699b55bc1915a393eb65e4c53 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658702435; 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=bxwxOOD5yhDQL/GvIznRg2c3JH4C9ODYd6832LB4U+0=; b=wKhMNLymFoxCj6wl0qpyKbHr4aFLzxLeOk2pUmwL2quGu7oX8tKULo2Vv8JssdyU3LFcLY PYRdCmBhSTT8JdLWpGZ4l+TDZ6Ju5ELaITQuCe2ANZEG+QFILlcO/Yj2YcKUm8MDBHf89J dREffKPR8/r9sS+ShU1/WwkBcmBC015ip6T6Stji+9Pzsw5eWqcODDVzv2V0dHlhGyH2e1 2mT2DomHvbCLaptbav391rSaId692CuipwbrWuXsnKh71ua+qEJffWmrjTRKmCkn60yV8z PQhkIBY+lfw/NZonHk/uv9mEp6ueY3qFq7DwI6k8ZxmXe5U3Rl0AjFPyu2Tllw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658702435; a=rsa-sha256; cv=none; b=RMSqqX/r1sAdMy0tcY+CKf9rmhU+UWwXwicH8+3gwexqVW+me/i3LGTr0TqQqt7ZLEUxax vKBDwrRnaKo1EzSoIrpJ91VLSczPU0SKhZ3NFlsJQKf/e/WzfIvNmMB2LsPY7iiWZBCfB2 4QRa+Qcux0KrktDCE7cU6uX2Lg5Vd8GKcjShQ0tUbskqkSgh1CSXhPqJbjI64ph0M16RM0 e4EZMbF9eWRFvmxhp1rOMXTV7qIcwFEqcStssHE0Xsj2IyEiC1cJwBtS2oqNhLBtfSFFNU AHgr+BYM+efZPbkViuuuXQ2HEA/N39lsBqmYpGgV3fwQTINK7TRf3xEGkC1d6A== 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=f4f847018048ac7699b55bc1915a393eb65e4c53 commit f4f847018048ac7699b55bc1915a393eb65e4c53 Author: Dimitry Andric AuthorDate: 2022-07-24 20:54:08 +0000 Commit: Dimitry Andric CommitDate: 2022-07-24 22:40:12 +0000 Fix unused variable warning in icl_soft.c With clang 15, the following -Werror warning is produced: sys/dev/iscsi//icl_soft.c:886:6: error: variable 'coalesced' set but not used [-Werror,-Wunused-but-set-variable] int coalesced, error; ^ The 'coalesced' variable is eventually used only in an #if 0'd block, obviously meant for debugging. Ensure that 'coalesced' is only declared and used when DEBUG_COALESCED is defined, so the debugging can be easily turned on later, if desired. MFC after: 3 days --- sys/dev/iscsi/icl_soft.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/dev/iscsi/icl_soft.c b/sys/dev/iscsi/icl_soft.c index 669cb9618d3a..700f1c6e79f8 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -883,7 +883,10 @@ icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue) struct mbuf *m; struct socket *so; long available, size, size2; - int coalesced, error; +#ifdef DEBUG_COALESCED + int coalesced; +#endif + int error; ICL_CONN_LOCK_ASSERT_NOT(ic); @@ -942,7 +945,15 @@ icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue) } if (coalesce) { m = request->ip_bhs_mbuf; - for (coalesced = 1; ; coalesced++) { + for ( +#ifdef DEBUG_COALESCED + coalesced = 1 +#endif + ; ; +#ifdef DEBUG_COALESCED + coalesced++ +#endif + ) { request2 = STAILQ_FIRST(queue); if (request2 == NULL) break; @@ -967,7 +978,7 @@ icl_conn_send_pdus(struct icl_soft_conn *isc, struct icl_pdu_stailq *queue) size += size2; icl_soft_pdu_done(request2, 0); } -#if 0 +#ifdef DEBUG_COALESCED if (coalesced > 1) { ICL_DEBUG("coalesced %d PDUs into %ld bytes", coalesced, size);