Skip to contentSkip to conversation

ALSA: pcm: Remove snd_pcm_lib_preallocate_dma_free()

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Dec 18, 2020 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: pcm: Remove snd_pcm_lib_preallocate_dma_free()

Since commit d4cfb30fce03 ("ALSA: pcm: Set per-card upper limit of PCM buffer allocations") snd_pcm_lib_preallocate_dma_free() is a single line function that has one caller, which is another single line function.

Clean this up a bit and remove snd_pcm_lib_preallocate_dma_free() and directly call do_free_pages() from snd_pcm_lib_preallocate_free(). This is a bit less boilerplate.

---
 sound/core/pcm_memory.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
sound/core/pcm_memory.c +1 -9
index 4f03ba8ed0ae..ee6e9c5eec45 100644
@@ -89,14 +89,6 @@ static int preallocate_pcm_pages(struct snd_pcm_substream *substream, size_t siz
 	return 0;
 }
 
-/*
- * release the preallocated buffer if not yet done.
- */
-static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream)
-{
-	do_free_pages(substream->pcm->card, &substream->dma_buffer);
-}
-
 /**
  * snd_pcm_lib_preallocate_free - release the preallocated buffer of the specified substream.
  * @substream: the pcm substream instance
@@ -105,7 +97,7 @@ static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream
  */
 void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream)
 {
-	snd_pcm_lib_preallocate_dma_free(substream);
+	do_free_pages(substream->pcm->card, &substream->dma_buffer);
 }
 
 /**
Signature · 1 line
2.20.1
Applied
#1 lore raw
Quoted 10 lines · Lars-Peter Clausen

Since commit d4cfb30fce03 ("ALSA: pcm: Set per-card upper limit of PCM buffer allocations") snd_pcm_lib_preallocate_dma_free() is a single line function that has one caller, which is another single line function.

Clean this up a bit and remove snd_pcm_lib_preallocate_dma_free() and directly call do_free_pages() from snd_pcm_lib_preallocate_free(). This is a bit less boilerplate.

Thanks, applied.

Takashi