git: fb357da6977c - main - sound/midi: Remove unused and dead code

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Thu, 12 Nov 2026 16:38:08 UTC
The branch main has been updated by christos:

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

commit fb357da6977c7684fccf3fb1ed3fd9a99d9fbb7c
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-10 13:54:33 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-11-12 16:35:48 +0000

    sound/midi: Remove unused and dead code
    
    No functional change intended.
    
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
---
 sys/dev/sound/midi/midi.c   |  5 ++---
 sys/dev/sound/midi/mpu401.c | 36 ++++++------------------------------
 sys/dev/sound/midi/mpu401.h |  7 +++----
 sys/dev/sound/pci/csamidi.c |  2 --
 4 files changed, 11 insertions(+), 39 deletions(-)

diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c
index 5b812af749e3..6561bd8a6f52 100644
--- a/sys/dev/sound/midi/midi.c
+++ b/sys/dev/sound/midi/midi.c
@@ -63,7 +63,6 @@ struct midi_queue {
 	int	used;			/* Bytes queued. */
 };
 
-#define MIDI_NAMELEN   16
 struct snd_midi {
 	KOBJ_FIELDS;
 	struct mtx lock;
@@ -517,8 +516,8 @@ err0:	return retval;
 }
 
 int
-midi_ioctl(struct cdev *i_dev, unsigned long cmd, caddr_t arg, int mode,
-    struct thread *td)
+midi_ioctl(struct cdev *i_dev __unused, unsigned long cmd __unused,
+    caddr_t arg __unused, int mode __unused, struct thread *td __unused)
 {
 	return ENXIO;
 }
diff --git a/sys/dev/sound/midi/mpu401.c b/sys/dev/sound/midi/mpu401.c
index d3fb6b214d3e..b117510fe889 100644
--- a/sys/dev/sound/midi/mpu401.c
+++ b/sys/dev/sound/midi/mpu401.c
@@ -47,12 +47,8 @@
 #define MPU_STATPORT   1
 #define MPU_RESET      0xff
 #define MPU_UART       0x3f
-#define MPU_ACK        0xfe
-#define MPU_STATMASK   0xc0
 #define MPU_OUTPUTBUSY 0x40
 #define MPU_INPUTBUSY  0x80
-#define MPU_TRYDATA 50
-#define MPU_DELAY   2500
 
 #define CMD(m,d)	MPUFOI_WRITE(m, m->cookie, MPU_CMDPORT,d)
 #define STATUS(m)	MPUFOI_READ(m, m->cookie, MPU_STATPORT)
@@ -105,8 +101,6 @@ mpu401_intr(struct mpu401 *m)
 	int i;
 	int s;
 
-#define RXRDY(m) ( (STATUS(m) & MPU_INPUTBUSY) == 0)
-#define TXRDY(m) ( (STATUS(m) & MPU_OUTPUTBUSY) == 0)
 	i = 0;
 	s = STATUS(m);
 	while ((s & MPU_INPUTBUSY) == 0 && i < MPU_INTR_BUF) {
@@ -166,42 +160,24 @@ err:
 int
 mpu401_uninit(struct mpu401 *m)
 {
-	int retval;
-
 	CMD(m, MPU_RESET);
-	retval = midi_uninit(m->mid);
-	if (retval)
-		return retval;
+	midi_uninit(m->mid);
 	free(m, M_MIDI);
 	return 0;
 }
 
 static int
-mpu401_minit(struct snd_midi *sm, void *arg)
+mpu401_minit(struct snd_midi *sm __unused, void *arg)
 {
 	struct mpu401 *m = arg;
-	int i;
 
 	CMD(m, MPU_RESET);
 	CMD(m, MPU_UART);
 	return 0;
-	i = 0;
-	while (++i < 2000) {
-		if (RXRDY(m))
-			if (READ(m) == MPU_ACK)
-				break;
-	}
-
-	if (i < 2000) {
-		CMD(m, MPU_UART);
-		return 0;
-	}
-	printf("mpu401_minit failed active sensing\n");
-	return 1;
 }
 
 static int
-mpu401_muninit(struct snd_midi *sm, void *arg)
+mpu401_muninit(struct snd_midi *sm __unused, void *arg)
 {
 	struct mpu401 *m = arg;
 
@@ -209,19 +185,19 @@ mpu401_muninit(struct snd_midi *sm, void *arg)
 }
 
 static int
-mpu401_minqsize(struct snd_midi *sm, void *arg)
+mpu401_minqsize(struct snd_midi *sm __unused, void *arg __unused)
 {
 	return 128;
 }
 
 static int
-mpu401_moutqsize(struct snd_midi *sm, void *arg)
+mpu401_moutqsize(struct snd_midi *sm __unused, void *arg __unused)
 {
 	return 128;
 }
 
 static void
-mpu401_mcallback(struct snd_midi *sm, void *arg, int flags)
+mpu401_mcallback(struct snd_midi *sm __unused, void *arg, int flags)
 {
 	struct mpu401 *m = arg;
 
diff --git a/sys/dev/sound/midi/mpu401.h b/sys/dev/sound/midi/mpu401.h
index 677d17b3a9e4..7b1c9a28c4e1 100644
--- a/sys/dev/sound/midi/mpu401.h
+++ b/sys/dev/sound/midi/mpu401.h
@@ -33,9 +33,8 @@ struct mpu401;
 
 typedef int mpu401_intr_t(struct mpu401 *_obj);
 
-extern struct mpu401 *
-mpu401_init(kobj_class_t _cls, void *cookie, driver_intr_t *_softintr,
-    mpu401_intr_t ** _cb);
-extern int mpu401_uninit(struct mpu401 *_obj);
+struct mpu401 *mpu401_init(kobj_class_t _cls, void *cookie,
+    driver_intr_t *_softintr, mpu401_intr_t ** _cb);
+int mpu401_uninit(struct mpu401 *_obj);
 
 #endif
diff --git a/sys/dev/sound/pci/csamidi.c b/sys/dev/sound/pci/csamidi.c
index 1559c38114af..b5a7d8b9d366 100644
--- a/sys/dev/sound/pci/csamidi.c
+++ b/sys/dev/sound/pci/csamidi.c
@@ -59,8 +59,6 @@
 #define	MPU_STATPORT	1
 #define	MPU_RESET	0xff
 #define	MPU_UART	0x3f
-#define	MPU_ACK		0xfe
-#define	MPU_STATMASK	0xc0
 #define	MPU_OUTPUTBUSY	0x40
 #define	MPU_INPUTBUSY	0x80