git: 8717135d3750 - main - emu10kx: eliminate write only variables val, r and move i to loop

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 05 Apr 2022 04:32:42 UTC
The branch main has been updated by imp:

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

commit 8717135d3750b3d0c80c8783c547ffffe255c04f
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-04-05 02:23:43 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-04-05 04:30:13 +0000

    emu10kx: eliminate write only variables val, r and move i to loop
    
    Sponsored by:           Netflix
---
 sys/dev/sound/pci/emu10kx.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c
index f40d60156a9c..9d321997487f 100644
--- a/sys/dev/sound/pci/emu10kx.c
+++ b/sys/dev/sound/pci/emu10kx.c
@@ -732,7 +732,6 @@ emu_wr_p16vptr(struct emu_sc_info *sc, uint16_t chn, uint16_t reg, uint32_t data
 static void
 emu_wr_cbptr(struct emu_sc_info *sc, uint32_t data)
 {
-	uint32_t val;
 
 	/*
 	 * 0x38 is IPE3 (CD S/PDIF interrupt pending register) on CA0102. Seems
@@ -740,9 +739,9 @@ emu_wr_cbptr(struct emu_sc_info *sc, uint32_t data)
 	 * CA0108, with value(?) in top 16 bit, address(?) in low 16
 	 */
 
-	val = emu_rd_nolock(sc, 0x38, 4);
+	emu_rd_nolock(sc, 0x38, 4);
 	emu_wr_nolock(sc, 0x38, data, 4);
-	val = emu_rd_nolock(sc, 0x38, 4);
+	emu_rd_nolock(sc, 0x38, 4);
 
 }
 
@@ -1267,10 +1266,9 @@ emu_valloc(struct emu_sc_info *sc)
 void
 emu_vfree(struct emu_sc_info *sc, struct emu_voice *v)
 {
-	int i, r;
 
 	mtx_lock(&sc->lock);
-	for (i = 0; i < NUM_G; i++) {
+	for (int i = 0; i < NUM_G; i++) {
 		if (v == &sc->voice[i] && sc->voice[i].busy) {
 			v->busy = 0;
 			/*
@@ -1279,7 +1277,7 @@ emu_vfree(struct emu_sc_info *sc, struct emu_voice *v)
 			 * this problem
 			 */
 			if (v->slave != NULL)
-				r = emu_memfree(&sc->mem, v->vbuf);
+				emu_memfree(&sc->mem, v->vbuf);
 		}
 	}
 	mtx_unlock(&sc->lock);