Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2022 18:49:21 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: b33bfe6e1574 - main - Fix unused variable warnings in tcp_hpts.c
Message-ID:  <202208151849.27FInL8e027724@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=b33bfe6e157429ad764e9a883a5e3a194a6d1f9f

commit b33bfe6e157429ad764e9a883a5e3a194a6d1f9f
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-08-15 18:14:39 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-08-15 18:48:34 +0000

    Fix unused variable warnings in tcp_hpts.c
    
    With clang 15, the following -Werror warning is produced:
    
        sys/netinet/tcp_hpts.c:1114:10: error: variable 'paced_cnt' set but not used [-Werror,-Wunused-but-set-variable]
                int32_t paced_cnt = 0;
                        ^
        sys/netinet/tcp_hpts.c:1112:11: error: variable 'total_slots_processed' set but not used [-Werror,-Wunused-but-set-variable]
                uint64_t total_slots_processed = 0;
                         ^
    
    The 'paced_cnt' variable was in tcp_hpts.c when it was first added, and
    the 'total_slots_processed' variable was added in d7955cc0ffdf9, but
    both appear to have been debugging aids that have never been used, so
    remove them.
    
    MFC after:      3 days
---
 sys/netinet/tcp_hpts.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c
index 4df5a236dcce..b8d09523113f 100644
--- a/sys/netinet/tcp_hpts.c
+++ b/sys/netinet/tcp_hpts.c
@@ -1109,9 +1109,7 @@ tcp_hptsi(struct tcp_hpts_entry *hpts, int from_callout)
 	struct tcpcb *tp;
 	struct inpcb *inp;
 	struct timeval tv;
-	uint64_t total_slots_processed = 0;
 	int32_t slots_to_run, i, error;
-	int32_t paced_cnt = 0;
 	int32_t loop_cnt = 0;
 	int32_t did_prefetch = 0;
 	int32_t prefetch_ninp = 0;
@@ -1258,8 +1256,6 @@ again:
 				/* Record the new position */
 				orig_exit_slot = runningslot;
 			}
-			total_slots_processed++;
-			paced_cnt++;
 
 			INP_WLOCK(inp);
 			if (inp->inp_hpts_cpu_set == 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202208151849.27FInL8e027724>