From nobody Fri Jul 29 18:48:14 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 4Lvc3M6D22z4Y1m6; Fri, 29 Jul 2022 18:48:15 +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 4Lvc3M1QmSz3s2p; Fri, 29 Jul 2022 18:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120495; 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=6pKppNiBq0a9YFK7w4M0nYc4MY+sqUJiEfY7qv/zNqI=; b=Kwz4jDX9TOQ1RuGbS3J2hVIsdO2pRZ+SC9Btv5ig3W7QgoJff8Axg9SBG3lnGhbrCnFwKL 2WOIfryo5HGdn164Id+01uBkiWtT1nHwxW+Jl1RNPfekIEpaFZkQqq0ZZOjH6La/79RzOE R/GTpzo0oSL57jnXfimNKTai3kMkJ1ke02jfh9D2ar1BYnMfX4oFShJPwti5/X9uWRIXs4 UlITJzRlNsMSFa5GRmM1XvzsIKLnejp/JQmQHPCCcdwLGIUVJn/b38dTSdkWaWUFWBaCGV L+6BU82SODMbvZ8PcsWBFKk0g9Pkc4rRsCISEcOl1Xr1ZabMuO8HxJbz0gg6qg== 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 4Lvc3M0NB1zlkH; Fri, 29 Jul 2022 18:48:15 +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 26TImEUt025123; Fri, 29 Jul 2022 18:48:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TImEUN025122; Fri, 29 Jul 2022 18:48:14 GMT (envelope-from git) Date: Fri, 29 Jul 2022 18:48:14 GMT Message-Id: <202207291848.26TImEUN025122@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: 63e8ce61d72a - stable/12 - Fix unused variable warning in sctp_timer.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: 63e8ce61d72a01da4f74f560e993ecafcd914e10 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120495; 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=6pKppNiBq0a9YFK7w4M0nYc4MY+sqUJiEfY7qv/zNqI=; b=NBmLn71fTyBz5Z4RH7/BOYspaj0ZPiNadPFFbrpPaRoCPFkwyaoPzYlTFWtEmBIuyxDN3I MBMJsgvHszvfrwa6we4/858sGRb6111x7CWO7vojQfwiJgpwPLz8DTASKFn8ghK2TdkZQl joDMZ/u1d498/cMOeXHuAwT5EXJ29VokfnuIU91nUPg5jxuYHfZRwLC9pCqITZ3fy30EEd RueP7IfxGefs3Mn4DnNs7Ws21vUXY0WZK6UOt+Bbnl3K4k6q+aCNxwS7L3skCz0Aa0e9T/ 766kj6puKOZ1HOcvejpQKgzmUIVAYugsqYYSNX8j3BJ8wy2JPDvhd+0BYTFsBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659120495; a=rsa-sha256; cv=none; b=ZVQ0rIyiOMyQfPbGxJcj9eQcMXWEujZ+Q1e3Hfo+JWccoPHizIvEK1usmgeJ/bauSUDP1g 02ZdBaPwJPNU3xBMOITwd+7JznxQEQ8/Ufu4thk3+6piUjS1+yEPgL2pkMxjFZvRtaSWSw E4sy1Gr9W6MVRUfozNxI3+fFOIgNsGZNywT0mj3w3EOkHlBqEMLdIYKuMkzWohoN/uQUrf Y+CHwHnA5ZOKoT5Bbw1OuOjZHebcQJ7UDKEXsNvbW/+faako2ImNlkYx/MdGJ42xYDFa8Z ud6YOQKi5L5dw3AQxVtS2/kF7aK0SUPMOi/Md8fldfZ+mtAXOMFtf+VXAYNSCg== 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=63e8ce61d72a01da4f74f560e993ecafcd914e10 commit 63e8ce61d72a01da4f74f560e993ecafcd914e10 Author: Dimitry Andric AuthorDate: 2022-07-25 20:06:28 +0000 Commit: Dimitry Andric CommitDate: 2022-07-29 18:35:36 +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 (cherry picked from commit 5bfd8cf3691381c19296d76d7944d6c1df5f4a75) --- 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 b5f84bcf3665..c9cd64961c8c 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -494,7 +494,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 */ @@ -553,10 +555,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) {