From nobody Mon Jul 25 19:51:10 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 4Ls9dq1RP9z4WbJl; Mon, 25 Jul 2022 19:51:11 +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 4Ls9dq0d3lz3jnq; Mon, 25 Jul 2022 19:51:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658778671; 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=7KEyCG8Hsq1CBl6PTANzS6hDXlrALno4fX0703szlAQ=; b=eivaeJuLUm9qpx8erSC/p3VPZZw5G7n3lPTybljKePIG7toGOvkvewpB9GNWK2bdB8wweo u6ZeFH7Z0i9SKuck0i1O4PVhYIDmJ87uAGuzl0khw5iCUjukHG04THx8OSnDii6cP/b2vd I4JizBgvV9eqsBYwqybwD6Zu4iVvSda4Zkt8hiBZkRSgRa+v5ogj23VlKCLZbuxftN9QTH UiFF8DnhUDPnvfqu9axe5rth6dgsPzGB0acSyUVh9thGNEQurekBYKcpM0WWe7GeQVokX6 Na6Wf7Bx7gb03yL5t4m/cYzcVBalvXt7tQjQgvQbJj2D7rDM9nDfU0dkCJFX9w== 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 4Ls9dp6Sn0z18QW; Mon, 25 Jul 2022 19:51:10 +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 26PJpAVS003364; Mon, 25 Jul 2022 19:51:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26PJpAYY003363; Mon, 25 Jul 2022 19:51:10 GMT (envelope-from git) Date: Mon, 25 Jul 2022 19:51:10 GMT Message-Id: <202207251951.26PJpAYY003363@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: 05b3a4282c40 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 05b3a4282c408f495add570bbca12242dd006279 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658778671; 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=7KEyCG8Hsq1CBl6PTANzS6hDXlrALno4fX0703szlAQ=; b=n6++kK21axmBsxW3qUJj7wvKZH18hDvbElxY86KRSq8KasrfZVbspVxi3kaQkTtifPHLzl c49S8++CW6lgNRo0evft/ILpg1sXyL56lRTGfS5xVBRaipZPEt1MGAg6Ax34tT1HOb1hik XMvUjfjQxGN9imWYlfI9gdZ6Asu2HYlk/WHeMTXiYe1y7Ok9onMzLAZgimunT35Pl99iGG DrqhyEN3Vn/0HLLFF1SAansYgyxwUY9glBVE3BHcYOU50N+bmI/mroRBa/n4CxSVjNkanv n9W5u75OdbqbKapK+ZJaL5j9ErSjJMU8t5lL6GRsJW+6IqT1b8E3nwig8YLpmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658778671; a=rsa-sha256; cv=none; b=mBL8locP+hBGPcWkMijgGl4XwH3evaE2+KzP8GO51IHCAauE+wUyeudZZMtBeGhPiGMVMw zDsqQCvOwsvFvhRlKVqZDQGBbztnE2vnqY9bvTsTdoZnT063oOfxHnPkSBA9Pu1PiaiZzC ipBMSX2ZwYCIBApaYSR6u2WdQWMNCs3BpwN1bmWbMjADL1l2SwYNYmBCsgm5cCdebOF1fZ FtjUvy0sOIN8YXpqgkiXJK1XrOUfm8Qx2hu/J4zOIdJSy56RI7y47o0ihoenHClDFZYbCf C1naHXMFvzY/g28wCy1h97GNbVZsFNS9fXdp040vUIf2AGt5uE1pZu/QkhxHIw== 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=05b3a4282c408f495add570bbca12242dd006279 commit 05b3a4282c408f495add570bbca12242dd006279 Author: Dimitry Andric AuthorDate: 2022-07-25 19:15:52 +0000 Commit: Dimitry Andric CommitDate: 2022-07-25 19:16:05 +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 --- 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 8a2c30827198..d3c969bb47b1 100644 --- a/sys/netinet/sctp_indata.c +++ b/sys/netinet/sctp_indata.c @@ -3306,7 +3306,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; @@ -3694,7 +3693,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", @@ -3839,9 +3837,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 @@ -3861,13 +3860,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 } }