From nobody Wed Jul 27 19:21:27 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 4LtNtb3rbyz4XShm; Wed, 27 Jul 2022 19:21:27 +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 4LtNtb2ztHz3K7w; Wed, 27 Jul 2022 19:21:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658949687; 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=54o+9tk1+LWPXTvmUUlQlSJLjmtkhVSG9mSde/490RI=; b=An+cr/0Hwnn1hzNpe5QJMevaZyRcRKhNKSl9LflJhQeOo+xMCVr0oPvUwzlQCTGc5R4Bts f31cNq1noaNxJfx2pqudlLjXBauo5f2B1aHaVfQr54N8ivLZk6yRBb0FxmZGF7/hvIi+qF CUq0Eq83jRul3XpGtI1w91wHt7hTqQXqWLj67LdmFfcRW5eg/Xvrkqd6YflOr3sXMWijXy R3fjT3b71iydtYHRXaqxjwIdlc7yIbeP+SQMTBTcd/LPROZjYKdrZ77gdURV0nthIrok34 /9/2afxufBfu7HYYnFV7wSJFB4kCDphO8mvJVsQ0kmhCXIUQQKJgTH5u910fpw== 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 4LtNtb1qdhzSNQ; Wed, 27 Jul 2022 19:21:27 +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 26RJLRjt071659; Wed, 27 Jul 2022 19:21:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26RJLRR9071658; Wed, 27 Jul 2022 19:21:27 GMT (envelope-from git) Date: Wed, 27 Jul 2022 19:21:27 GMT Message-Id: <202207271921.26RJLRR9071658@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: f14c6e0789b9 - stable/12 - Fix unused variable warning in icl_soft.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/stable/12 X-Git-Reftype: branch X-Git-Commit: f14c6e0789b990c5df40f6b09015ba17ec1e3f6d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658949687; 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=54o+9tk1+LWPXTvmUUlQlSJLjmtkhVSG9mSde/490RI=; b=jtFcGJjxWWztUzc7bH9GigOaHuwir5wvS/J6jpqsjX7a3U8jNzwy3AvD+M5pm5AKOQI8hw jdxAka44wETitqv3hBuk+nZAg5lfDzNx03GKJmYggu+hLDMQgvbExXziyvhQoAsaD/Adfp KHAoEeZI3qNQbkFM4g+SrGWM/7Hat7/TBrvFGIM6fShsYZsTDHv4Sbkfl6DN4W70ZWj078 goZ1t1/LIZF5XFE36MndfLMx/i/wqlLnO0B/aS7Ej2/3rVXsgw4EAWydGGw6CRriFjELaO sbej3+y8nwemqo62u2SzSr/MtyZSr7+6CtI8XH0iEJxaC+fecmUNkgL1NKozUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658949687; a=rsa-sha256; cv=none; b=USdCmfTVfOZZNIZ4tJWahm/iWzF2o8BR3yljnXCuw96oQKoOPGy5sSadhuMGFNI37nQrBP k+tky77aNz0vvQ+2PdnJ8pmwAUU4cUwqhq6izPihMtkOkAy29ewnhmOq3JD2+1Vcqnq2mO K4zLICu7RVlE3Ipc+U/Ew0os8qNpmo7S4WMHns+X+CFYii2y0+xPtOk5R8evCTftoAPzvk utg6jxV4xtOe5xsfmoRxR1hClJqoTqjJM2OUH5EY4vrQyPL3czm+Ye5Hx8lYdABYEBYFYd h9IgtrRiQVkXbcPgOePvO57HF8KvqHG3Q+EIR0RgP+dTyPfJMc44RFznrCGnOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=f14c6e0789b990c5df40f6b09015ba17ec1e3f6d commit f14c6e0789b990c5df40f6b09015ba17ec1e3f6d Author: Dimitry Andric AuthorDate: 2022-07-24 20:54:08 +0000 Commit: Dimitry Andric CommitDate: 2022-07-27 19:21:13 +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 (cherry picked from commit f4f847018048ac7699b55bc1915a393eb65e4c53) --- 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 d04dbdafd65f..29825e12cc10 100644 --- a/sys/dev/iscsi/icl_soft.c +++ b/sys/dev/iscsi/icl_soft.c @@ -798,7 +798,10 @@ icl_conn_send_pdus(struct icl_conn *ic, 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); @@ -858,7 +861,15 @@ icl_conn_send_pdus(struct icl_conn *ic, 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; @@ -883,7 +894,7 @@ icl_conn_send_pdus(struct icl_conn *ic, struct icl_pdu_stailq *queue) size += size2; icl_soft_conn_pdu_free(ic, request2); } -#if 0 +#ifdef DEBUG_COALESCED if (coalesced > 1) { ICL_DEBUG("coalesced %d PDUs into %ld bytes", coalesced, size);