git: 47bdb815f31d - stable/15 - sound: Do not use double pointer in dsp_io_ops()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 20 Nov 2025 13:31:44 UTC
The branch stable/15 has been updated by christos:
URL: https://cgit.FreeBSD.org/src/commit/?id=47bdb815f31dc9b584700ed988a729e3f239378a
commit 47bdb815f31dc9b584700ed988a729e3f239378a
Author: Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-11-13 14:35:53 +0000
Commit: Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-11-20 13:28:15 +0000
sound: Do not use double pointer in dsp_io_ops()
No reason to do so.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D53734
(cherry picked from commit fa7bc983076661e85107970e39de66a1e54d87d1)
---
sys/dev/sound/pcm/dsp.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index f7188fd16356..1ae090f252c2 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -462,7 +462,7 @@ static __inline int
dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf)
{
struct snddev_info *d;
- struct pcm_channel **ch;
+ struct pcm_channel *ch;
int (*chn_io)(struct pcm_channel *, struct uio *);
int prio, ret;
pid_t runpid;
@@ -476,12 +476,12 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf)
switch (buf->uio_rw) {
case UIO_READ:
prio = FREAD;
- ch = &priv->rdch;
+ ch = priv->rdch;
chn_io = chn_read;
break;
case UIO_WRITE:
prio = FWRITE;
- ch = &priv->wrch;
+ ch = priv->wrch;
chn_io = chn_write;
break;
}
@@ -490,21 +490,21 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf)
dsp_lock_chans(priv, prio);
- if (*ch == NULL || !((*ch)->flags & CHN_F_BUSY)) {
+ if (ch == NULL || !(ch->flags & CHN_F_BUSY)) {
if (priv->rdch != NULL || priv->wrch != NULL)
dsp_unlock_chans(priv, prio);
PCM_GIANT_EXIT(d);
return (EBADF);
}
- if (((*ch)->flags & (CHN_F_MMAP | CHN_F_DEAD)) ||
- (((*ch)->flags & CHN_F_RUNNING) && (*ch)->pid != runpid)) {
+ if (ch->flags & (CHN_F_MMAP | CHN_F_DEAD) ||
+ (ch->flags & CHN_F_RUNNING && ch->pid != runpid)) {
dsp_unlock_chans(priv, prio);
PCM_GIANT_EXIT(d);
return (EINVAL);
- } else if (!((*ch)->flags & CHN_F_RUNNING)) {
- (*ch)->flags |= CHN_F_RUNNING;
- (*ch)->pid = runpid;
+ } else if (!(ch->flags & CHN_F_RUNNING)) {
+ ch->flags |= CHN_F_RUNNING;
+ ch->pid = runpid;
}
/*
@@ -512,11 +512,11 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf)
* from/to userland, so up the "in progress" counter to make sure
* someone else doesn't come along and muss up the buffer.
*/
- ++(*ch)->inprog;
- ret = chn_io(*ch, buf);
- --(*ch)->inprog;
+ ch->inprog++;
+ ret = chn_io(ch, buf);
+ ch->inprog--;
- CHN_BROADCAST(&(*ch)->cv);
+ CHN_BROADCAST(&ch->cv);
dsp_unlock_chans(priv, prio);