git: 3861bafb68f6 - main - firewire(4): Fix "set but not used" warnings

From: Edward Tomasz Napierala <trasz_at_FreeBSD.org>
Date: Mon, 20 Dec 2021 11:42:48 UTC
The branch main has been updated by trasz:

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

commit 3861bafb68f6c60e4688b844fb6a678e29095655
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2021-12-18 15:10:45 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2021-12-20 11:24:21 +0000

    firewire(4): Fix "set but not used" warnings
    
    Sponsored By:   EPSRC
---
 sys/dev/firewire/firewire.c | 5 ++++-
 sys/dev/firewire/if_fwe.c   | 4 ++++
 sys/dev/firewire/sbp.c      | 2 --
 sys/dev/firewire/sbp_targ.c | 4 ----
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c
index bf197406a767..45f3ac3cb79d 100644
--- a/sys/dev/firewire/firewire.c
+++ b/sys/dev/firewire/firewire.c
@@ -1907,8 +1907,9 @@ fw_rcv(struct fw_rcv_buf *rb)
 	struct fw_pkt *fp, *resfp;
 	struct fw_bind *bind;
 	int tcode;
-	int i, len, oldstate;
+	int oldstate;
 #if 0
+	int i, len;
 	{
 		uint32_t *qld;
 		int i;
@@ -2035,9 +2036,11 @@ fw_rcv(struct fw_rcv_buf *rb)
 				fw_xfer_free(rb->xfer);
 			return;
 		}
+#if 0
 		len = 0;
 		for (i = 0; i < rb->nvec; i++)
 			len += rb->vec[i].iov_len;
+#endif
 		rb->xfer = STAILQ_FIRST(&bind->xferlist);
 		if (rb->xfer == NULL) {
 			device_printf(rb->fc->bdev, "%s: "
diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c
index 35d1a41fad6f..657fd6515fca 100644
--- a/sys/dev/firewire/if_fwe.c
+++ b/sys/dev/firewire/if_fwe.c
@@ -554,7 +554,9 @@ fwe_as_input(struct fw_xferq *xferq)
 	struct fwe_softc *fwe;
 	struct fw_bulkxfer *sxfer;
 	struct fw_pkt *fp;
+#if 0
 	u_char *c;
+#endif
 
 	fwe = (struct fwe_softc *)xferq->sc;
 	ifp = fwe->eth_softc.ifp;
@@ -583,7 +585,9 @@ fwe_as_input(struct fw_xferq *xferq)
 		}
 
 		m->m_data += HDR_LEN + ETHER_ALIGN;
+#if 0
 		c = mtod(m, u_char *);
+#endif
 		m->m_len = m->m_pkthdr.len = fp->mode.stream.len - ETHER_ALIGN;
 		m->m_pkthdr.rcvif = ifp;
 #if 0
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index a161713a94ad..877c39a901a6 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -935,7 +935,6 @@ static void
 sbp_mgm_callback(struct fw_xfer *xfer)
 {
 	struct sbp_dev *sdev;
-	int resp;
 
 	sdev = (struct sbp_dev *)xfer->sc;
 
@@ -943,7 +942,6 @@ SBP_DEBUG(1)
 	device_printf(sdev->target->sbp->fd.dev,
 		"%s:%s\n", __func__, sdev->bustgtlun);
 END_DEBUG
-	resp = xfer->resp;
 	SBP_LOCK(sdev->target->sbp);
 	sbp_xfer_free(xfer);
 	SBP_UNLOCK(sdev->target->sbp);
diff --git a/sys/dev/firewire/sbp_targ.c b/sys/dev/firewire/sbp_targ.c
index f1b302528213..1832703818ff 100644
--- a/sys/dev/firewire/sbp_targ.c
+++ b/sys/dev/firewire/sbp_targ.c
@@ -1419,7 +1419,6 @@ sbp_targ_poll(struct cam_sim *sim)
 static void
 sbp_targ_cmd_handler(struct fw_xfer *xfer)
 {
-	struct fw_pkt *fp;
 	uint32_t *orb;
 	struct corb4 *orb4;
 	struct orb_info *orbi;
@@ -1441,7 +1440,6 @@ sbp_targ_cmd_handler(struct fw_xfer *xfer)
 		fw_xfer_free(xfer);
 		return;
 	}
-	fp = &xfer->recv.hdr;
 
 	atio = orbi->atio;
 
@@ -1574,7 +1572,6 @@ sbp_targ_mgm_handler(struct fw_xfer *xfer)
 {
 	struct sbp_targ_lstate *lstate;
 	struct sbp_targ_login *login;
-	struct fw_pkt *fp;
 	uint32_t *orb;
 	struct morb4 *orb4;
 	struct orb_info *orbi;
@@ -1594,7 +1591,6 @@ sbp_targ_mgm_handler(struct fw_xfer *xfer)
 		fw_xfer_free(xfer);
 		return;
 	}
-	fp = &xfer->recv.hdr;
 
 	orb = orbi->orb;
 	/* swap payload */