From nobody Fri Jul 29 18:48:19 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 4Lvc3T4XS9z4Y23h; Fri, 29 Jul 2022 18:48:21 +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 4Lvc3R58Nfz3sCK; Fri, 29 Jul 2022 18:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120499; 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=BYC3oaP+5eMQVV6tF0mXa9Mo1HWrQj4ZcacFIIvLfDE=; b=CsEkzsvrbed3epzp0Y0Rwi0x2dJPJv6v4RTEF/4zgb7mY93PzH98jA/ETH6PTXJnbW5UXb 6BDIQXKKUXiua1w1ebFft6e5kyYUuzEQV2UcVPHFLsrFsSnHMPNInijQuNiY0LEiN/7GYt Igr/jEtS+9XCT6SdQDpxLeyw5X9Cyi1f5OpmNqJjj0fFOCu2T+oNVA0MbMYM7PZQTd+706 powui11zytY9q22OBnPpGe6LdhdHxLYs1JnziT85l3fpk6l6iLfsl/X8Jk+TaEWU79vfXE qJj4F1nK+I972cxNO7wnEH4qWxvdjYKISIPnMMIh53RQPkJAkprnS6eolwo8FQ== 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 4Lvc3R4Db0zmB6; Fri, 29 Jul 2022 18:48:19 +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 26TImJwG025226; Fri, 29 Jul 2022 18:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TImJbi025225; Fri, 29 Jul 2022 18:48:19 GMT (envelope-from git) Date: Fri, 29 Jul 2022 18:48:19 GMT Message-Id: <202207291848.26TImJbi025225@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: 61cc49884d26 - stable/12 - Fix unused variable warnings in sctp_indata.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: 61cc49884d268d4b7f71645fe81f5af544b55433 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120499; 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=BYC3oaP+5eMQVV6tF0mXa9Mo1HWrQj4ZcacFIIvLfDE=; b=Jwg+2d8RXHo/VImUD+QqEPuLV4yiKqmKaIW+f8WurWF3trAVTDqiwAVJcD38MpGiA2f5jo YA+NYVzYjGkdA9JrbgDb0anzEx48JP1NeuLA473pyEztDDTMFG25wZXSFdKcB3lDo7P0yW Y5Y4odV3FP2mu3Ex+X4HHxzsN2hs083kZeomacjX1ODgzRuzSFBNkE8IG8GU2kFhmigqMA 21kp6nYPPImlhKYpzSvGleRK6PrWXYhswM9giXW5TqxV1DkBqyCFqoWqHZ2mI4+fHiZjLK LgEFhq/RAvami0qb1tCYqEQoCWfBSJhj1+ldWb+HuMLesuDCmMEaeOi2cceOuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659120499; a=rsa-sha256; cv=none; b=dPk/7pbT707ETfcF0RzqgkNEqghnbUfJSsC9/IZLJ6E5YKGixZOAfZ3dIG8rvUYaqKwuPP V4V4wObcag2VRbUS6E1A7vyB1pQi4rzgS2I/QuESYi2uhLNiJce/7jwT9Z0ewfGOyc+/r0 dRrlD7LqK7lRub5L2YJ/aqQ1txaKvehTT69C9HCxs2DBLf9viUMop9/efUu8QZjdIfFLLi Fy0UV1tn2zoOHdF58Jd+luGYVeRaaCg4dMPOVPvMsQdYc1WHUuFN63YKeT3fl5vPl5vE0P z0bBQ3vN9936dI3+39muhf8cIZ8jUP0sZsUuPtH3bKQp9Z04xOAO8L8Lt06ZCA== 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=61cc49884d268d4b7f71645fe81f5af544b55433 commit 61cc49884d268d4b7f71645fe81f5af544b55433 Author: Dimitry Andric AuthorDate: 2022-07-25 19:15:52 +0000 Commit: Dimitry Andric CommitDate: 2022-07-29 18:35:36 +0000 Fix unused variable warnings in sctp_indata.c With clang 15, the following -Werror warnings are produced: sys/netinet/sctp_indata.c:3309:6: error: variable 'tot_retrans' set but not used [-Werror,-Wunused-but-set-variable] int tot_retrans = 0; ^ sys/netinet/sctp_indata.c:3842:20: error: variable 'resend' set but not used [-Werror,-Wunused-but-set-variable] int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; ^ sys/netinet/sctp_indata.c:3842:47: error: variable 'acked' set but not used [-Werror,-Wunused-but-set-variable] int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; ^ sys/netinet/sctp_indata.c:3842:58: error: variable 'above' set but not used [-Werror,-Wunused-but-set-variable] int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; ^ The 'tot_retrans' variable was used in sctp_strike_gap_ack_chunks(), but refactoring in 493d8e5a830e got rid of it. Remove the variable since it no longer serves any purpose. The 'resend', 'acked', and 'above' variables are only used when INVARIANTS is undefined. Ensure they are only declared and set in that case. MFC after: 3 days (cherry picked from commit 05b3a4282c408f495add570bbca12242dd006279) --- sys/netinet/sctp_indata.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/netinet/sctp_indata.c b/sys/netinet/sctp_indata.c index 70398c0777b1..6ef1bef668b5 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -3321,7 +3321,6 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_tmit_chunk *tp1; int strike_flag = 0; struct timeval now; - int tot_retrans = 0; uint32_t sending_seq; struct sctp_nets *net; int num_dests_sacked = 0; @@ -3711,7 +3710,6 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc, } tp1->rec.data.doing_fast_retransmit = 1; - tot_retrans++; /* mark the sending seq for possible subsequent FR's */ /* * SCTP_PRINTF("Marking TSN for FR new value %x\n", @@ -3856,9 +3854,10 @@ static int sctp_fs_audit(struct sctp_association *asoc) { struct sctp_tmit_chunk *chk; - int inflight = 0, resend = 0, inbetween = 0, acked = 0, above = 0; + int inflight = 0, inbetween = 0; int ret; #ifndef INVARIANTS + int resend = 0, acked = 0, above = 0; int entry_flight, entry_cnt; #endif @@ -3878,13 +3877,19 @@ sctp_fs_audit(struct sctp_association *asoc) chk->snd_count); inflight++; } else if (chk->sent == SCTP_DATAGRAM_RESEND) { +#ifndef INVARIANTS resend++; +#endif } else if (chk->sent < SCTP_DATAGRAM_ACKED) { inbetween++; } else if (chk->sent > SCTP_DATAGRAM_ACKED) { +#ifndef INVARIANTS above++; +#endif } else { +#ifndef INVARIANTS acked++; +#endif } }