* [PATCH] ALSA: pcm: Make snd_pcm_lib_malloc_pages() debug message say "allocate"
@ 2025-04-21 8:52 Chen-Yu Tsai
2025-04-22 13:00 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Chen-Yu Tsai @ 2025-04-21 8:52 UTC (permalink / raw)
To: Jaroslav Kysela, Takashi Iwai; +Cc: Chen-Yu Tsai, linux-sound, linux-kernel
snd_pcm_lib_malloc_pages() is commonly used for allocating buffers during
the hw_params callback, whereas preallocating buffers goes through
preallocate_pcm_pages().
Having the same terminology in the failure debug messages in both
misleads developers.
Change the debug message in snd_pcm_lib_malloc_pages() to use the
term "allocate" to match its intended use.
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
I found this small discrepancy in the ALSA PCM memory management debug
messages that made it a bit confusing for me to trace code.
sound/core/pcm_memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c
index ea3941f8666b..56725d36825b 100644
--- a/sound/core/pcm_memory.c
+++ b/sound/core/pcm_memory.c
@@ -458,7 +458,7 @@ int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size)
substream->stream,
size, dmab) < 0) {
kfree(dmab);
- pr_debug("ALSA pcmC%dD%d%c,%d:%s: cannot preallocate for size %zu\n",
+ pr_debug("ALSA pcmC%dD%d%c,%d:%s: cannot allocate for size %zu\n",
substream->pcm->card->number, substream->pcm->device,
substream->stream ? 'c' : 'p', substream->number,
substream->pcm->name, size);
--
2.49.0.805.g082f7c87e0-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ALSA: pcm: Make snd_pcm_lib_malloc_pages() debug message say "allocate"
2025-04-21 8:52 [PATCH] ALSA: pcm: Make snd_pcm_lib_malloc_pages() debug message say "allocate" Chen-Yu Tsai
@ 2025-04-22 13:00 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2025-04-22 13:00 UTC (permalink / raw)
To: Chen-Yu Tsai; +Cc: Jaroslav Kysela, Takashi Iwai, linux-sound, linux-kernel
On Mon, 21 Apr 2025 10:52:42 +0200,
Chen-Yu Tsai wrote:
>
> snd_pcm_lib_malloc_pages() is commonly used for allocating buffers during
> the hw_params callback, whereas preallocating buffers goes through
> preallocate_pcm_pages().
>
> Having the same terminology in the failure debug messages in both
> misleads developers.
>
> Change the debug message in snd_pcm_lib_malloc_pages() to use the
> term "allocate" to match its intended use.
>
> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> ---
> I found this small discrepancy in the ALSA PCM memory management debug
> messages that made it a bit confusing for me to trace code.
Thanks, applied now to for-next branch.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-04-22 13:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-21 8:52 [PATCH] ALSA: pcm: Make snd_pcm_lib_malloc_pages() debug message say "allocate" Chen-Yu Tsai
2025-04-22 13:00 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox