git: a41ab6befba2 - main - sound/midi: Clean up zero assignments
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 Nov 2026 16:38:13 UTC
The branch main has been updated by christos:
URL: https://cgit.FreeBSD.org/src/commit/?id=a41ab6befba220c9acf9b9ee09931f598d4862ea
commit a41ab6befba220c9acf9b9ee09931f598d4862ea
Author: Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-12 09:35:58 +0000
Commit: Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-11-12 16:35:49 +0000
sound/midi: Clean up zero assignments
No functional change intended.
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
---
sys/dev/sound/midi/midi.c | 16 ++++------------
sys/dev/sound/midi/mpu401.c | 1 -
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c
index a078c02dc767..03add9adea23 100644
--- a/sys/dev/sound/midi/midi.c
+++ b/sys/dev/sound/midi/midi.c
@@ -166,7 +166,6 @@ midi_init(kobj_class_t cls, void *cookie)
m->outq.buf = obuf;
m->outq.size = outqsize;
- m->flags = 0;
m->unit = alloc_unr(dev_unr);
m->channel = alloc_unr(chn_unr);
m->cookie = cookie;
@@ -226,7 +225,7 @@ midi_uninit(struct snd_midi *m)
int
midi_in(struct snd_midi *m, uint8_t *buf, int size)
{
- int used;
+ int used = 0;
mtx_lock(&m->lock);
@@ -236,8 +235,6 @@ midi_in(struct snd_midi *m, uint8_t *buf, int size)
return (size);
}
- used = 0;
-
if (size <= midi_queue_avail(&m->inq)) {
used = size;
midi_queue_enq(&m->inq, buf, size);
@@ -291,15 +288,13 @@ int
midi_open(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
struct snd_midi *m = i_dev->si_drv1;
- int retval;
+ int retval = 0;
if (m == NULL)
return ENXIO;
mtx_lock(&m->lock);
- retval = 0;
-
if (flags & FREAD) {
if (m->inq.size == 0)
retval = ENXIO;
@@ -343,7 +338,7 @@ int
midi_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
{
struct snd_midi *m = i_dev->si_drv1;
- int retval;
+ int retval = 0;
int oldflags;
if (m == NULL)
@@ -367,7 +362,6 @@ midi_close(struct cdev *i_dev, int flags, int mode, struct thread *td)
if ((m->flags & (M_TXEN | M_RXEN)) != (oldflags & (M_RXEN | M_TXEN)))
MPU_CALLBACK(m, m->cookie, m->flags);
- retval = 0;
err:
mtx_unlock(&m->lock);
return retval;
@@ -527,13 +521,11 @@ int
midi_poll(struct cdev *i_dev, int events, struct thread *td)
{
struct snd_midi *m = i_dev->si_drv1;
- int revents;
+ int revents = 0;
if (m == NULL)
return 0;
- revents = 0;
-
mtx_lock(&m->lock);
if (events & (POLLIN | POLLRDNORM)) {
diff --git a/sys/dev/sound/midi/mpu401.c b/sys/dev/sound/midi/mpu401.c
index 61a9d1be40c8..003a0d581973 100644
--- a/sys/dev/sound/midi/mpu401.c
+++ b/sys/dev/sound/midi/mpu401.c
@@ -140,7 +140,6 @@ mpu401_init(kobj_class_t cls, void *cookie, driver_intr_t softintr,
m->si = softintr;
m->cookie = cookie;
- m->flags = 0;
m->mid = midi_init(&mpu401_class, m);
if (!m->mid)