Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 2026 10:39:04 +0000
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 127aa056fea0 - main - sound: Retire CHN_SETVOLUME() and use chn_setvolume_matrix()
Message-ID:  <69c269c8.34508.21ac81d3@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by christos:

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

commit 127aa056fea0714116952efb7664956e0f2b69cd
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-03-24 10:32:04 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-03-24 10:38:41 +0000

    sound: Retire CHN_SETVOLUME() and use chn_setvolume_matrix()
    
    CHN_SETVOLUME() is just a wrapped around chn_setvolume_matrix() anyway,
    so use it directly.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D55992
---
 sys/dev/sound/pcm/channel.c | 4 ++--
 sys/dev/sound/pcm/channel.h | 2 --
 sys/dev/sound/pcm/matrix.h  | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 5e7c5772af01..67bbfba28177 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -143,7 +143,7 @@ chn_vpc_proc(int reset, int db)
 		PCM_ACQUIRE(d);
 		CHN_FOREACH(c, d, channels.pcm) {
 			CHN_LOCK(c);
-			CHN_SETVOLUME(c, SND_VOL_C_PCM, SND_CHN_T_VOL_0DB, db);
+			chn_setvolume_matrix(c, SND_VOL_C_PCM, SND_CHN_T_VOL_0DB, db);
 			if (reset != 0)
 				chn_vpc_reset(c, SND_VOL_C_PCM, 1);
 			CHN_UNLOCK(c);
@@ -1635,7 +1635,7 @@ chn_vpc_reset(struct pcm_channel *c, int vc, int force)
 		return;
 
 	for (i = SND_CHN_T_BEGIN; i <= SND_CHN_T_END; i += SND_CHN_T_STEP)
-		CHN_SETVOLUME(c, vc, i, c->volume[vc][SND_CHN_T_VOL_0DB]);
+		chn_setvolume_matrix(c, vc, i, c->volume[vc][SND_CHN_T_VOL_0DB]);
 }
 
 static u_int32_t
diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h
index 22c2bf5a4d3e..0375bbfb006d 100644
--- a/sys/dev/sound/pcm/channel.h
+++ b/sys/dev/sound/pcm/channel.h
@@ -306,8 +306,6 @@ int chn_notify(struct pcm_channel *c, u_int32_t flags);
 int chn_getrates(struct pcm_channel *c, int **rates);
 int chn_syncdestroy(struct pcm_channel *c);
 
-#define CHN_SETVOLUME(...)		chn_setvolume_matrix(__VA_ARGS__)
-
 #define CHN_GETMUTE(x, y, z)		((x)->muted[y][z])
 
 #ifdef OSSV4_EXPERIMENT
diff --git a/sys/dev/sound/pcm/matrix.h b/sys/dev/sound/pcm/matrix.h
index f4a79fdc3b30..ffac162f41a1 100644
--- a/sys/dev/sound/pcm/matrix.h
+++ b/sys/dev/sound/pcm/matrix.h
@@ -176,8 +176,7 @@
 /*
  * Multichannel interleaved volume matrix. Each calculated value relative
  * to master and 0db will be stored in each CLASS + 1 as long as
- * chn_setvolume_matrix() or the equivalent CHN_SETVOLUME() macros is
- * used (see channel.c).
+ * chn_setvolume_matrix() is used (see channel.c).
  */
 #define SND_VOL_C_MASTER	0
 #define SND_VOL_C_PCM		1


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69c269c8.34508.21ac81d3>