From nobody Fri Jul 29 18:47:12 2022 X-Original-To: dev-commits-src-branches@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 4Lvc293Qcbz4Y1Wf; Fri, 29 Jul 2022 18:47:13 +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 4Lvc285fwvz3nbT; Fri, 29 Jul 2022 18:47:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120432; 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=NNt8fSVHYPQoozMwgGqTJvEVg3AhCrUj/DhHCReEp5Y=; b=peYcmGKtG+EI/S4t/rOTmpyaR5bEqYrh6NNVz6doln1/RWA6SthVvb3wWegaOmVWH0GQHQ D4bPvSEQfKdPTB9gh5tck6hsfmB/d4XToatQuDZ80zpGWQmuHfh4Cnt0qHNvxuUa3t3zW1 TR+m9K3/IULUO554oJ+EMVrZA72hIxzR+OHxFpBfPhQiDB4CsGoKkWcKNsSlZK7DdmRmDO JLzbPDofY71RViLXnBKwvoCNqKF5v8qG575TDBuanburJfUdXkkzHsalAvVfAv8Pqd6XsR s/WZ+VB8HPxZGttUFiXwldTfY+OTjhatqDkLoy0oNwOc5IxRNBoUgs2z6RHTnA== 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 4Lvc284KPdzlh0; Fri, 29 Jul 2022 18:47:12 +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 26TIlCiS023788; Fri, 29 Jul 2022 18:47:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26TIlCDr023787; Fri, 29 Jul 2022 18:47:12 GMT (envelope-from git) Date: Fri, 29 Jul 2022 18:47:12 GMT Message-Id: <202207291847.26TIlCDr023787@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: afd97f6b96cc - stable/13 - Fix unused variable warnings in sctp_indata.c List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: afd97f6b96cc4b70f60552a0e609e6a1bc15eb81 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659120432; 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=NNt8fSVHYPQoozMwgGqTJvEVg3AhCrUj/DhHCReEp5Y=; b=WteXCfzV8c3fbWpT/0rhIr5D7jqHG6/Of6fi5QBOhyl0SulIDFR3aiUzbSPaD9qpwJW+UZ tNxVwSYuRwwMrBw9BnDyec+EMxe7HMUbvEeWL1w3eWLuxK7lJ5f55GDesaSsXD6YHLuujO 3vowULrEAYEmRTJ9Sb7WTRu0ZIpm2k6zrhfwq362RtUpHAhWZbp2u/QJQXKOO18WSWo+9b xvIFBEjEwRnI8bZmQNDeEgmuANIxhcjfDRIe9GnTSZIJC2/rxGpeaOAhvhESVgPdB4EZyc vddYj7dJbYZQb8MSj/vX/nvr1URYCSpLKoOgHx7mXFmCiZvneYNSt/rpPlU3mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659120432; a=rsa-sha256; cv=none; b=x315qnt3gtjFpb8lRAzKW/1uwtkLsYlcQki1ZDI1iykKSb5+LwyWNK32geNFw4zZh1hiHR HRM/lm9cG9PXGG+ClZ/eYIDkl1Q0/NviTrwi2vjgBik6yQJQmtuMk3OEhKkxbYIvJ9ywly HE1xXDQRJAh6xlz6gO1teFZg61LyZuipW7qZNwKigXZlWX+gvhZr6nesidUVVw7KwnNucm 6o6DAYK8VbgSuHab8M2ZVDfkiWqo0rhH5BHCxouvD1OWb9OLv+tmg8O7Yhbc2GhbqXn6rw irnUpZUCsSsS5YtsE27CBY/bT8vp7odHGQy8kgwcbMGDWjvgKbEYv5KkyjLLgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=afd97f6b96cc4b70f60552a0e609e6a1bc15eb81 commit afd97f6b96cc4b70f60552a0e609e6a1bc15eb81 Author: Dimitry Andric AuthorDate: 2022-07-25 19:15:52 +0000 Commit: Dimitry Andric CommitDate: 2022-07-29 18:28:07 +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 fb1327a94475..18949ab9b6e2 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -3305,7 +3305,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; @@ -3693,7 +3692,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", @@ -3838,9 +3836,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 @@ -3860,13 +3859,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 } }