git: b338b1fd500a - main - tcp: plug set-but-not-used vars

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Tue, 19 Apr 2022 12:46:10 UTC
The branch main has been updated by mjg:

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

commit b338b1fd500a70726829e38c6eaf7ed31ab0e9f0
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-04-19 12:36:17 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-04-19 12:45:57 +0000

    tcp: plug set-but-not-used vars
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netinet/tcp_usrreq.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 8c8cba8ea5ad..e559d8f1fe76 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -301,7 +301,9 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
 {
 	int error = 0;
 	struct inpcb *inp;
+#ifdef KDTRACE_HOOKS
 	struct tcpcb *tp = NULL;
+#endif
 	struct sockaddr_in *sinp;
 
 	sinp = (struct sockaddr_in *)nam;
@@ -333,7 +335,9 @@ tcp_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
 		error = EINVAL;
 		goto out;
 	}
+#ifdef KDTRACE_HOOKS
 	tp = intotcpcb(inp);
+#endif
 	TCPDEBUG1();
 	INP_HASH_WLOCK(&V_tcbinfo);
 	error = in_pcbbind(inp, nam, td->td_ucred);
@@ -353,7 +357,9 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
 {
 	int error = 0;
 	struct inpcb *inp;
+#ifdef KDTRACE_HOOKS
 	struct tcpcb *tp = NULL;
+#endif
 	struct sockaddr_in6 *sin6;
 	u_char vflagsav;
 
@@ -379,7 +385,9 @@ tcp6_usr_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
 		error = EINVAL;
 		goto out;
 	}
+#ifdef KDTRACE_HOOKS
 	tp = intotcpcb(inp);
+#endif
 	TCPDEBUG1();
 	INP_HASH_WLOCK(&V_tcbinfo);
 	inp->inp_vflag &= ~INP_IPV4;
@@ -792,7 +800,9 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam)
 {
 	int error = 0;
 	struct inpcb *inp = NULL;
+#ifdef KDTRACE_HOOKS
 	struct tcpcb *tp = NULL;
+#endif
 	struct in_addr addr;
 	in_port_t port = 0;
 	TCPDEBUG0;
@@ -807,7 +817,9 @@ tcp_usr_accept(struct socket *so, struct sockaddr **nam)
 		error = ECONNABORTED;
 		goto out;
 	}
+#ifdef KDTRACE_HOOKS
 	tp = intotcpcb(inp);
+#endif
 	TCPDEBUG1();
 
 	/*
@@ -834,7 +846,9 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam)
 {
 	struct inpcb *inp = NULL;
 	int error = 0;
+#ifdef KDTRACE_HOOKS
 	struct tcpcb *tp = NULL;
+#endif
 	struct in_addr addr;
 	struct in6_addr addr6;
 	struct epoch_tracker et;
@@ -853,7 +867,9 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam)
 		error = ECONNABORTED;
 		goto out;
 	}
+#ifdef KDTRACE_HOOKS
 	tp = intotcpcb(inp);
+#endif
 	TCPDEBUG1();
 
 	/*