Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2024 11:56:26 GMT
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: 29ff7b08be36 - main - sound: Rename chn_* feeder functions to feeder_*
Message-ID:  <202407271156.46RBuQ6j039998@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by christos:

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

commit 29ff7b08be363f0d4345794bb951d5c0c8406a0a
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2024-07-27 11:55:37 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2024-07-27 11:55:37 +0000

    sound: Rename chn_* feeder functions to feeder_*
    
    Avoid layering violation. No functional change intended.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      2 days
    Reviewed by:    dev_submerge.ch
    Differential Revision:  https://reviews.freebsd.org/D45983
---
 sys/dev/sound/pcm/channel.c      |  8 ++++----
 sys/dev/sound/pcm/feeder.c       |  6 +++---
 sys/dev/sound/pcm/feeder.h       |  6 +++---
 sys/dev/sound/pcm/feeder_chain.c | 16 ++++++++--------
 sys/dev/sound/pcm/feeder_eq.c    |  4 ++--
 sys/dev/sound/pcm/feeder_rate.c  |  2 +-
 sys/dev/sound/pcm/mixer.c        |  2 +-
 7 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 19808a43631a..511d5256c06b 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -1287,7 +1287,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls,
 		    __func__);
 		goto out2;
 	}
-	if (chn_addfeeder(c, fc, NULL)) {
+	if (feeder_add(c, fc, NULL)) {
 		device_printf(d->dev, "%s(): failed to add feeder\n", __func__);
 		goto out2;
 	}
@@ -1365,7 +1365,7 @@ out2:
 	if (CHN_LOCKOWNED(c))
 		CHN_UNLOCK(c);
 	if (ret) {
-		while (chn_removefeeder(c) == 0)
+		while (feeder_remove(c) == 0)
 			;
 		if (c->devinfo) {
 			if (CHANNEL_FREE(c->methods, c->devinfo))
@@ -1407,7 +1407,7 @@ chn_kill(struct pcm_channel *c)
 		chn_trigger(c, PCMTRIG_ABORT);
 		CHN_UNLOCK(c);
 	}
-	while (chn_removefeeder(c) == 0)
+	while (feeder_remove(c) == 0)
 		;
 	if (CHANNEL_FREE(c->methods, c->devinfo))
 		sndbuf_free(b);
@@ -2300,7 +2300,7 @@ chn_syncstate(struct pcm_channel *c)
 		else
 			bass = ((bass & 0x7f) + ((bass >> 8) & 0x7f)) >> 1;
 
-		f = chn_findfeeder(c, FEEDER_EQ);
+		f = feeder_find(c, FEEDER_EQ);
 		if (f != NULL) {
 			if (FEEDER_SET(f, FEEDEQ_TREBLE, treble) != 0)
 				device_printf(c->dev,
diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c
index 0113299bd0d4..fdbf2a8353e0 100644
--- a/sys/dev/sound/pcm/feeder.c
+++ b/sys/dev/sound/pcm/feeder.c
@@ -232,7 +232,7 @@ feeder_getclass(struct pcm_feederdesc *desc)
 }
 
 int
-chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc)
+feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc)
 {
 	struct pcm_feeder *nf;
 
@@ -250,7 +250,7 @@ chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederd
 }
 
 int
-chn_removefeeder(struct pcm_channel *c)
+feeder_remove(struct pcm_channel *c)
 {
 	struct pcm_feeder *f;
 
@@ -264,7 +264,7 @@ chn_removefeeder(struct pcm_channel *c)
 }
 
 struct pcm_feeder *
-chn_findfeeder(struct pcm_channel *c, u_int32_t type)
+feeder_find(struct pcm_channel *c, u_int32_t type)
 {
 	struct pcm_feeder *f;
 
diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h
index c3d6f89d102e..f2a865d3d2f9 100644
--- a/sys/dev/sound/pcm/feeder.h
+++ b/sys/dev/sound/pcm/feeder.h
@@ -58,10 +58,10 @@ u_int32_t snd_fmtbestbit(u_int32_t fmt, u_int32_t *fmts);
 u_int32_t snd_fmtbestchannel(u_int32_t fmt, u_int32_t *fmts);
 u_int32_t snd_fmtbest(u_int32_t fmt, u_int32_t *fmts);
 
-int chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc,
+int feeder_add(struct pcm_channel *c, struct feeder_class *fc,
     struct pcm_feederdesc *desc);
-int chn_removefeeder(struct pcm_channel *c);
-struct pcm_feeder *chn_findfeeder(struct pcm_channel *c, u_int32_t type);
+int feeder_remove(struct pcm_channel *c);
+struct pcm_feeder *feeder_find(struct pcm_channel *c, u_int32_t type);
 void feeder_printchain(struct pcm_feeder *head);
 int feeder_chain(struct pcm_channel *);
 
diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c
index 52351ef58510..555cd86d60e5 100644
--- a/sys/dev/sound/pcm/feeder_chain.c
+++ b/sys/dev/sound/pcm/feeder_chain.c
@@ -157,7 +157,7 @@ feeder_build_format(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 	desc->in = cdesc->current.afmt;
 	desc->out = cdesc->target.afmt;
 
-	ret = chn_addfeeder(c, fc, desc);
+	ret = feeder_add(c, fc, desc);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_format\n", __func__);
@@ -230,7 +230,7 @@ feeder_build_rate(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 	desc->in = cdesc->current.afmt;
 	desc->out = desc->in;
 
-	ret = chn_addfeeder(c, fc, desc);
+	ret = feeder_add(c, fc, desc);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_rate\n", __func__);
@@ -309,7 +309,7 @@ feeder_build_matrix(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 	desc->out = SND_FORMAT(cdesc->current.afmt,
 	    cdesc->target.matrix->channels, cdesc->target.matrix->ext);
 
-	ret = chn_addfeeder(c, fc, desc);
+	ret = feeder_add(c, fc, desc);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_matrix\n", __func__);
@@ -365,7 +365,7 @@ feeder_build_volume(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 	desc->in = cdesc->current.afmt;
 	desc->out = desc->in;
 
-	ret = chn_addfeeder(c, fc, desc);
+	ret = feeder_add(c, fc, desc);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_volume\n", __func__);
@@ -433,7 +433,7 @@ feeder_build_eq(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 	desc->in = cdesc->current.afmt;
 	desc->out = desc->in;
 
-	ret = chn_addfeeder(c, fc, desc);
+	ret = feeder_add(c, fc, desc);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_eq\n", __func__);
@@ -472,7 +472,7 @@ feeder_build_root(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 		return (ENOTSUP);
 	}
 
-	ret = chn_addfeeder(c, fc, NULL);
+	ret = feeder_add(c, fc, NULL);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_root\n", __func__);
@@ -513,7 +513,7 @@ feeder_build_mixer(struct pcm_channel *c, struct feeder_chain_desc *cdesc)
 	desc->in = cdesc->current.afmt;
 	desc->out = desc->in;
 
-	ret = chn_addfeeder(c, fc, desc);
+	ret = feeder_add(c, fc, desc);
 	if (ret != 0) {
 		device_printf(c->dev,
 		    "%s(): can't add feeder_mixer\n", __func__);
@@ -588,7 +588,7 @@ feeder_chain(struct pcm_channel *c)
 	CHN_LOCKASSERT(c);
 
 	/* Remove everything first. */
-	while (chn_removefeeder(c) == 0)
+	while (feeder_remove(c) == 0)
 		;
 
 	KASSERT(c->feeder == NULL, ("feeder chain not empty"));
diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c
index a097b13cd986..3c9d9cda9d62 100644
--- a/sys/dev/sound/pcm/feeder_eq.c
+++ b/sys/dev/sound/pcm/feeder_eq.c
@@ -584,7 +584,7 @@ sysctl_dev_pcm_eq(SYSCTL_HANDLER_ARGS)
 
 		CHN_FOREACH(c, d, channels.pcm.busy) {
 			CHN_LOCK(c);
-			f = chn_findfeeder(c, FEEDER_EQ);
+			f = feeder_find(c, FEEDER_EQ);
 			if (f != NULL)
 				(void)FEEDER_SET(f, FEEDEQ_STATE, val);
 			CHN_UNLOCK(c);
@@ -643,7 +643,7 @@ sysctl_dev_pcm_eq_preamp(SYSCTL_HANDLER_ARGS)
 
 			CHN_FOREACH(c, d, channels.pcm.busy) {
 				CHN_LOCK(c);
-				f = chn_findfeeder(c, FEEDER_EQ);
+				f = feeder_find(c, FEEDER_EQ);
 				if (f != NULL)
 					(void)FEEDER_SET(f, FEEDEQ_PREAMP, val);
 				CHN_UNLOCK(c);
diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c
index c8cc67e8fa80..77de21e7a31a 100644
--- a/sys/dev/sound/pcm/feeder_rate.c
+++ b/sys/dev/sound/pcm/feeder_rate.c
@@ -268,7 +268,7 @@ sysctl_hw_snd_feeder_rate_quality(SYSCTL_HANDLER_ARGS)
 		PCM_ACQUIRE(d);
 		CHN_FOREACH(c, d, channels.pcm) {
 			CHN_LOCK(c);
-			f = chn_findfeeder(c, FEEDER_RATE);
+			f = feeder_find(c, FEEDER_RATE);
 			if (f == NULL || f->data == NULL || CHN_STARTED(c)) {
 				CHN_UNLOCK(c);
 				continue;
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 0cf6a9f42f8f..6d74fa975f03 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -224,7 +224,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *d,
 
 	CHN_FOREACH(c, d, channels.pcm.busy) {
 		CHN_LOCK(c);
-		f = chn_findfeeder(c, FEEDER_EQ);
+		f = feeder_find(c, FEEDER_EQ);
 		if (f != NULL)
 			(void)FEEDER_SET(f, tone, level);
 		CHN_UNLOCK(c);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202407271156.46RBuQ6j039998>