* [PATCH 0/5] ALSA: core: removing unused functions
@ 2025-05-02 23:52 linux
2025-05-02 23:52 ` [PATCH 1/5] ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits linux
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: linux @ 2025-05-02 23:52 UTC (permalink / raw)
To: perex, tiwai, linux-sound; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
Hi,
This is a small set of deadcode removal from sound/core;
they're all full function removal rather than changing the
code inside functions.
Dave
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Dr. David Alan Gilbert (5):
ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits
ALSA: pcm: Remove unused snd_dmaengine_pcm_open_request_chan
ALSA: seq: Remove unused snd_seq_queue_client_leave_cells
ALSA: core: Remove unused snd_device_get_state
ALSA: core: Remove unused snd_jack_set_parent
include/sound/core.h | 1 -
include/sound/dmaengine_pcm.h | 2 --
include/sound/jack.h | 6 ------
include/sound/pcm.h | 2 --
sound/core/device.c | 23 -----------------------
sound/core/jack.c | 19 -------------------
sound/core/pcm_dmaengine.c | 21 ---------------------
sound/core/pcm_misc.c | 30 ------------------------------
sound/core/seq/seq_queue.c | 16 ----------------
sound/core/seq/seq_queue.h | 1 -
10 files changed, 121 deletions(-)
--
2.49.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/5] ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
@ 2025-05-02 23:52 ` linux
2025-05-02 23:52 ` [PATCH 2/5] ALSA: pcm: Remove unused snd_dmaengine_pcm_open_request_chan linux
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-05-02 23:52 UTC (permalink / raw)
To: perex, tiwai, linux-sound; +Cc: linux-kernel, Dr. David Alan Gilbert
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/5] ALSA: pcm: Remove unused snd_dmaengine_pcm_open_request_chan
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
2025-05-02 23:52 ` [PATCH 1/5] ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits linux
@ 2025-05-02 23:52 ` linux
2025-05-02 23:52 ` [PATCH 3/5] ALSA: seq: Remove unused snd_seq_queue_client_leave_cells linux
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-05-02 23:52 UTC (permalink / raw)
To: perex, tiwai, linux-sound; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
snd_dmaengine_pcm_open_request_chan() last use was removed in 2022's
commit b401d1fd8053 ("ASoC: pxa: remove unused board support")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
include/sound/dmaengine_pcm.h | 2 --
sound/core/pcm_dmaengine.c | 21 ---------------------
2 files changed, 23 deletions(-)
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
index f6baa9a01868..1ef13bcdc43f 100644
--- a/include/sound/dmaengine_pcm.h
+++ b/include/sound/dmaengine_pcm.h
@@ -38,8 +38,6 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream);
-int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream,
- dma_filter_fn filter_fn, void *filter_data);
int snd_dmaengine_pcm_close_release_chan(struct snd_pcm_substream *substream);
struct dma_chan *snd_dmaengine_pcm_request_channel(dma_filter_fn filter_fn,
diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
index b134a51b3fd5..72040964b6fd 100644
--- a/sound/core/pcm_dmaengine.c
+++ b/sound/core/pcm_dmaengine.c
@@ -328,27 +328,6 @@ int snd_dmaengine_pcm_open(struct snd_pcm_substream *substream,
}
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open);
-/**
- * snd_dmaengine_pcm_open_request_chan - Open a dmaengine based PCM substream and request channel
- * @substream: PCM substream
- * @filter_fn: Filter function used to request the DMA channel
- * @filter_data: Data passed to the DMA filter function
- *
- * This function will request a DMA channel using the passed filter function and
- * data. The function should usually be called from the pcm open callback. Note
- * that this function will use private_data field of the substream's runtime. So
- * it is not available to your pcm driver implementation.
- *
- * Return: 0 on success, a negative error code otherwise
- */
-int snd_dmaengine_pcm_open_request_chan(struct snd_pcm_substream *substream,
- dma_filter_fn filter_fn, void *filter_data)
-{
- return snd_dmaengine_pcm_open(substream,
- snd_dmaengine_pcm_request_channel(filter_fn, filter_data));
-}
-EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_open_request_chan);
-
int snd_dmaengine_pcm_sync_stop(struct snd_pcm_substream *substream)
{
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/5] ALSA: seq: Remove unused snd_seq_queue_client_leave_cells
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
2025-05-02 23:52 ` [PATCH 1/5] ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits linux
2025-05-02 23:52 ` [PATCH 2/5] ALSA: pcm: Remove unused snd_dmaengine_pcm_open_request_chan linux
@ 2025-05-02 23:52 ` linux
2025-05-02 23:52 ` [PATCH 4/5] ALSA: core: Remove unused snd_device_get_state linux
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-05-02 23:52 UTC (permalink / raw)
To: perex, tiwai, linux-sound; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
The last use of snd_seq_queue_client_leave_cells() was removed in 2018
by
commit 85d59b57be59 ("ALSA: seq: Remove superfluous
snd_seq_queue_client_leave_cells() call")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
sound/core/seq/seq_queue.c | 16 ----------------
sound/core/seq/seq_queue.h | 1 -
2 files changed, 17 deletions(-)
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index 5df26788dda4..10add922323d 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -564,22 +564,6 @@ void snd_seq_queue_client_leave(int client)
/*----------------------------------------------------------------*/
-/* remove cells from all queues */
-void snd_seq_queue_client_leave_cells(int client)
-{
- int i;
- struct snd_seq_queue *q;
-
- for (i = 0; i < SNDRV_SEQ_MAX_QUEUES; i++) {
- q = queueptr(i);
- if (!q)
- continue;
- snd_seq_prioq_leave(q->tickq, client, 0);
- snd_seq_prioq_leave(q->timeq, client, 0);
- queuefree(q);
- }
-}
-
/* remove cells based on flush criteria */
void snd_seq_queue_remove_cells(int client, struct snd_seq_remove_events *info)
{
diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h
index 74cc31aacdac..b81379c9af43 100644
--- a/sound/core/seq/seq_queue.h
+++ b/sound/core/seq/seq_queue.h
@@ -66,7 +66,6 @@ void snd_seq_queue_client_leave(int client);
int snd_seq_enqueue_event(struct snd_seq_event_cell *cell, int atomic, int hop);
/* Remove events */
-void snd_seq_queue_client_leave_cells(int client);
void snd_seq_queue_remove_cells(int client, struct snd_seq_remove_events *info);
/* return pointer to queue structure for specified id */
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/5] ALSA: core: Remove unused snd_device_get_state
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
` (2 preceding siblings ...)
2025-05-02 23:52 ` [PATCH 3/5] ALSA: seq: Remove unused snd_seq_queue_client_leave_cells linux
@ 2025-05-02 23:52 ` 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
5 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-05-02 23:52 UTC (permalink / raw)
To: perex, tiwai, linux-sound; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
snd_device_get_state() last use was removed in 2022 by
commit 7e1afce5866e ("ALSA: usb-audio: Inform the delayed registration more
properly")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
include/sound/core.h | 1 -
sound/core/device.c | 23 -----------------------
2 files changed, 24 deletions(-)
diff --git a/include/sound/core.h b/include/sound/core.h
index 1f3f5dccd736..64327e971122 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -326,7 +326,6 @@ void snd_device_disconnect(struct snd_card *card, void *device_data);
void snd_device_disconnect_all(struct snd_card *card);
void snd_device_free(struct snd_card *card, void *device_data);
void snd_device_free_all(struct snd_card *card);
-int snd_device_get_state(struct snd_card *card, void *device_data);
/* isadma.c */
diff --git a/sound/core/device.c b/sound/core/device.c
index b57d80a17052..cdc5af526739 100644
--- a/sound/core/device.c
+++ b/sound/core/device.c
@@ -237,26 +237,3 @@ void snd_device_free_all(struct snd_card *card)
list_for_each_entry_safe_reverse(dev, next, &card->devices, list)
__snd_device_free(dev);
}
-
-/**
- * snd_device_get_state - Get the current state of the given device
- * @card: the card instance
- * @device_data: the data pointer to release
- *
- * Returns the current state of the given device object. For the valid
- * device, either @SNDRV_DEV_BUILD, @SNDRV_DEV_REGISTERED or
- * @SNDRV_DEV_DISCONNECTED is returned.
- * Or for a non-existing device, -1 is returned as an error.
- *
- * Return: the current state, or -1 if not found
- */
-int snd_device_get_state(struct snd_card *card, void *device_data)
-{
- struct snd_device *dev;
-
- dev = look_for_dev(card, device_data);
- if (dev)
- return dev->state;
- return -1;
-}
-EXPORT_SYMBOL_GPL(snd_device_get_state);
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 5/5] ALSA: core: Remove unused snd_jack_set_parent
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
` (3 preceding siblings ...)
2025-05-02 23:52 ` [PATCH 4/5] ALSA: core: Remove unused snd_device_get_state linux
@ 2025-05-02 23:52 ` linux
2025-05-05 10:36 ` [PATCH 0/5] ALSA: core: removing unused functions Takashi Iwai
5 siblings, 0 replies; 7+ messages in thread
From: linux @ 2025-05-02 23:52 UTC (permalink / raw)
To: perex, tiwai, linux-sound; +Cc: linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
snd_jack_set_parent() was added as part of 2008's
commit e76d8ceaaff9 ("ALSA: Add jack reporting API")
but hasn't been used.
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
include/sound/jack.h | 6 ------
sound/core/jack.c | 19 -------------------
2 files changed, 25 deletions(-)
diff --git a/include/sound/jack.h b/include/sound/jack.h
index 1ed90e2109e9..36dc104c1145 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -79,7 +79,6 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
struct snd_jack **jack, bool initial_kctl, bool phantom_jack);
int snd_jack_add_new_kctl(struct snd_jack *jack, const char * name, int mask);
#ifdef CONFIG_SND_JACK_INPUT_DEV
-void snd_jack_set_parent(struct snd_jack *jack, struct device *parent);
int snd_jack_set_key(struct snd_jack *jack, enum snd_jack_types type,
int keytype);
#endif
@@ -104,11 +103,6 @@ static inline void snd_jack_report(struct snd_jack *jack, int status)
#endif
#if !defined(CONFIG_SND_JACK) || !defined(CONFIG_SND_JACK_INPUT_DEV)
-static inline void snd_jack_set_parent(struct snd_jack *jack,
- struct device *parent)
-{
-}
-
static inline int snd_jack_set_key(struct snd_jack *jack,
enum snd_jack_types type,
int keytype)
diff --git a/sound/core/jack.c b/sound/core/jack.c
index e4bcecdf89b7..850f82340278 100644
--- a/sound/core/jack.c
+++ b/sound/core/jack.c
@@ -574,25 +574,6 @@ int snd_jack_new(struct snd_card *card, const char *id, int type,
EXPORT_SYMBOL(snd_jack_new);
#ifdef CONFIG_SND_JACK_INPUT_DEV
-/**
- * snd_jack_set_parent - Set the parent device for a jack
- *
- * @jack: The jack to configure
- * @parent: The device to set as parent for the jack.
- *
- * Set the parent for the jack devices in the device tree. This
- * function is only valid prior to registration of the jack. If no
- * parent is configured then the parent device will be the sound card.
- */
-void snd_jack_set_parent(struct snd_jack *jack, struct device *parent)
-{
- WARN_ON(jack->registered);
- guard(mutex)(&jack->input_dev_lock);
- if (jack->input_dev)
- jack->input_dev->dev.parent = parent;
-}
-EXPORT_SYMBOL(snd_jack_set_parent);
-
/**
* snd_jack_set_key - Set a key mapping on a jack
*
--
2.49.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 0/5] ALSA: core: removing unused functions
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
` (4 preceding siblings ...)
2025-05-02 23:52 ` [PATCH 5/5] ALSA: core: Remove unused snd_jack_set_parent linux
@ 2025-05-05 10:36 ` Takashi Iwai
5 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2025-05-05 10:36 UTC (permalink / raw)
To: linux; +Cc: perex, tiwai, linux-sound, linux-kernel
On Sat, 03 May 2025 01:52:14 +0200,
linux@treblig.org wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
> This is a small set of deadcode removal from sound/core;
> they're all full function removal rather than changing the
> code inside functions.
>
> Dave
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
>
>
> Dr. David Alan Gilbert (5):
> ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits
> ALSA: pcm: Remove unused snd_dmaengine_pcm_open_request_chan
> ALSA: seq: Remove unused snd_seq_queue_client_leave_cells
> ALSA: core: Remove unused snd_device_get_state
> ALSA: core: Remove unused snd_jack_set_parent
Applied all patches now to for-next branch. Thanks.
Takashi
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-05-05 10:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 23:52 [PATCH 0/5] ALSA: core: removing unused functions linux
2025-05-02 23:52 ` [PATCH 1/5] ALSA: pcm: Remove unused snd_pcm_rate_range_to_bits linux
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox