From nobody Mon Jul 25 20:08:49 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 4LsB2B1znhz4WdmP; Mon, 25 Jul 2022 20:08:50 +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 4LsB2B1HPXz3nFh; Mon, 25 Jul 2022 20:08:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658779730; 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=5l4jl1LhbjCq5vbxti/R/IBSaTCzINEFYQdh2SwHHFk=; b=F+plI+3+HZMIufcAsg6m8SqaR67y8FJNprIkusmE8qL1yiovXqCdzW+U6nOaQeKTPau2x1 Pq/fFqSwCAANbLmj/1HPqbyMTq/P2IXBN4l++URLFqoecg/KGq2VNfoO+Q8Clsiet03rM+ oZq4mWLh5PYmSmBnM1yxNTeDwqklj1qR39/ZfnQte2AhbqDO/d/gJDDYSnUQpsuC4+az3l AuCphc63cjsiilkpt9SjqOieooaZdmwp1HI0e3Y7fhGnHq5zMnhZ4AfUI8sCNTzngQhRQQ vOONUPJpYaOxbXBpmH6Ow3Upcz6VpoMdfPGY+r90+2WNzqqQqkCmadT45lCh6w== 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 4LsB2B0L25z195t; Mon, 25 Jul 2022 20:08:50 +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 26PK8nBi023169; Mon, 25 Jul 2022 20:08:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26PK8nQ2023168; Mon, 25 Jul 2022 20:08:49 GMT (envelope-from git) Date: Mon, 25 Jul 2022 20:08:49 GMT Message-Id: <202207252008.26PK8nQ2023168@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: 5bfd8cf36913 - main - Fix unused variable warning in sctp_timer.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: 5bfd8cf3691381c19296d76d7944d6c1df5f4a75 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658779730; 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=5l4jl1LhbjCq5vbxti/R/IBSaTCzINEFYQdh2SwHHFk=; b=SG1iRWqCX1bwriamXO7JFt/J6qBaIqAjc9Lv4D23k5M0//CwPBpWYJeEiVWwNiG+gRBuNT Cr5EB1NVANmcuTiK3JEcTWW8syhgegP8kzOwOglVV+UAl7ckQj8OqxQBefSRg3gvM0wDxA hgx9NdsZvFHl620Iwqw/bBXFaDzzEv0v/o6EgnzWNG/xTAJQCzex2fLQBBFBkwYsTwDBil RH5EbsZXXTD0FuVdr/1oGm0e+XRd4zRD3qyzc6H+tsEYb92C56yA9OFlj60Q2/za6ASWsX GasdV+L8RElmYS3nQ4ALJ6RK+Jrzvo7JPGfWlnZA3xfCU+eIp1dkaVcErI2uJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658779730; a=rsa-sha256; cv=none; b=gk6J/8d0WhWA0tchcnWBzGTCejY2zXF5kF5M2k9dZFrg5boj9HqtMhKu+OAcAhxs3H15SE IVsoaPxoTHRP4P84it5++UUIMeFpiEfOVfHoYf0d+F9ORu6lPP8NxXhbFf05u9S3QVI+JO n39rTF+rmwe7bPx4HpvKcRGFNF6a/iEUfU5qL78B55cmNPpObYnhwOBBFEQOfs01rLJPBN HiNjFclUahBu7soriJrgg/HevDMkcqFfCXfUPq//CL5fV4ipiF3CxqVrfoNOJoj3JciEBy hYXOHFtIaHCSPopeflkRr+LwvMfWf8O1pXJDYNFOh2ShRqtZVRHMIUzWlZeBdg== 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=5bfd8cf3691381c19296d76d7944d6c1df5f4a75 commit 5bfd8cf3691381c19296d76d7944d6c1df5f4a75 Author: Dimitry Andric AuthorDate: 2022-07-25 20:06:28 +0000 Commit: Dimitry Andric CommitDate: 2022-07-25 20:08:28 +0000 Fix unused variable warning in sctp_timer.c With clang 15, the following -Werror warning is produced: sys/netinet/sctp_timer.c:510:6: error: variable 'recovery_cnt' set but not used [-Werror,-Wunused-but-set-variable] int recovery_cnt = 0; ^ The 'recovery_cnt' variable is only used when INVARIANTS is undefined. Ensure it is only declared and set in that case. MFC after: 3 days --- sys/netinet/sctp_timer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 9eff569e0f53..c808b6751384 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -507,7 +507,9 @@ sctp_mark_all_for_resend(struct sctp_tcb *stcb, unsigned int cnt_mk; uint32_t orig_flight, orig_tf; uint32_t tsnlast, tsnfirst; +#ifndef INVARIANTS int recovery_cnt = 0; +#endif /* none in flight now */ audit_tf = 0; @@ -565,10 +567,10 @@ start_again: /* Strange case our list got out of order? */ SCTP_PRINTF("Our list is out of order? last_acked:%x chk:%x\n", (unsigned int)stcb->asoc.last_acked_seq, (unsigned int)chk->rec.data.tsn); - recovery_cnt++; #ifdef INVARIANTS panic("last acked >= chk on sent-Q"); #else + recovery_cnt++; SCTP_PRINTF("Recover attempts a restart cnt:%d\n", recovery_cnt); sctp_recover_sent_list(stcb); if (recovery_cnt < 10) {