From: linux@treblig.org
To: perex@perex.cz, tiwai@suse.com, linux-sound@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
"Dr. David Alan Gilbert" <linux@treblig.org>
Subject: [PATCH 1/5] ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits
Date: Sat, 3 May 2025 00:52:15 +0100 [thread overview]
Message-ID: <20250502235219.1000429-2-linux@treblig.org> (raw)
In-Reply-To: <20250502235219.1000429-1-linux@treblig.org>
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The last use of snd_pcm_rate_range_to_bits() was removed in 2016 by
commit b6b6e4d670c9 ("ASoC: topology: Fix setting of stream rates, rate_min
and rate_max")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
include/sound/pcm.h | 2 --
sound/core/pcm_misc.c | 30 ------------------------------
2 files changed, 32 deletions(-)
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 8becb4504887..a268de860259 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -1251,8 +1251,6 @@ unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit);
unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a,
unsigned int rates_b);
-unsigned int snd_pcm_rate_range_to_bits(unsigned int rate_min,
- unsigned int rate_max);
/**
* snd_pcm_set_runtime_buffer - Set the PCM runtime buffer
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index d3a08e292072..71eec32a7a0a 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -586,33 +586,3 @@ unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a,
return rates_a & rates_b;
}
EXPORT_SYMBOL_GPL(snd_pcm_rate_mask_intersect);
-
-/**
- * snd_pcm_rate_range_to_bits - converts rate range to SNDRV_PCM_RATE_xxx bit
- * @rate_min: the minimum sample rate
- * @rate_max: the maximum sample rate
- *
- * This function has an implicit assumption: the rates in the given range have
- * only the pre-defined rates like 44100 or 16000.
- *
- * Return: The SNDRV_PCM_RATE_xxx flag that corresponds to the given rate range,
- * or SNDRV_PCM_RATE_KNOT for an unknown range.
- */
-unsigned int snd_pcm_rate_range_to_bits(unsigned int rate_min,
- unsigned int rate_max)
-{
- unsigned int rates = 0;
- int i;
-
- for (i = 0; i < snd_pcm_known_rates.count; i++) {
- if (snd_pcm_known_rates.list[i] >= rate_min
- && snd_pcm_known_rates.list[i] <= rate_max)
- rates |= 1 << i;
- }
-
- if (!rates)
- rates = SNDRV_PCM_RATE_KNOT;
-
- return rates;
-}
-EXPORT_SYMBOL_GPL(snd_pcm_rate_range_to_bits);
--
2.49.0
next prev parent reply other threads:[~2025-05-02 23:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
2025-05-02 23:52 ` linux [this message]
2025-05-02 23:52 ` [PATCH 2/5] ALSA: pcm: Remove unused snd_dmaengine_pcm_open_request_chan linux
2025-05-02 23:52 ` [PATCH 3/5] ALSA: seq: Remove unused snd_seq_queue_client_leave_cells linux
2025-05-02 23:52 ` [PATCH 4/5] ALSA: core: Remove unused snd_device_get_state linux
2025-05-02 23:52 ` [PATCH 5/5] ALSA: core: Remove unused snd_jack_set_parent linux
2025-05-05 10:36 ` [PATCH 0/5] ALSA: core: removing unused functions Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250502235219.1000429-2-linux@treblig.org \
--to=linux@treblig.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox