git: b6e4f5ef2b6a - stable/13 - emu10kx: eliminate write only variables val, r and move i to loop

From: Warner Losh <imp_at_FreeBSD.org>
Date: Sun, 02 Oct 2022 04:29:52 UTC
The branch stable/13 has been updated by imp:

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

commit b6e4f5ef2b6a194576e12133c72ead8fe7a9c477
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-07-08 17:53:32 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-10-02 04:25:55 +0000

    emu10kx: eliminate write only variables val, r and move i to loop
    
    Sponsored by:           Netflix
    
    (cherry picked from commit 8717135d3750b3d0c80c8783c547ffffe255c04f)
---
 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 784fd7e27ae1..85c200631ca2 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);