projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6ffa6f3
)
ALSA: pcm: use exit controlled loop in snd_pcm_playback_silence()
author
Oswald Buddenhagen
<oswald.buddenhagen@gmx.de>
Fri, 5 May 2023 15:52:44 +0000
(17:52 +0200)
committer
Takashi Iwai
<tiwai@suse.de>
Fri, 5 May 2023 16:23:53 +0000
(18:23 +0200)
We already know that `frames` is greater than zero, because we just
checked it. So we don't need to check the loop condition on the first
iteration.
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link:
https://lore.kernel.org/r/20230505155244.2312199-7-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_lib.c
patch
|
blob
|
history
diff --git
a/sound/core/pcm_lib.c
b/sound/core/pcm_lib.c
index
17fc80a
..
9c121a9
100644
(file)
--- a/
sound/core/pcm_lib.c
+++ b/
sound/core/pcm_lib.c
@@
-123,14
+123,14
@@
void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_ufram
if (frames == 0)
return;
ofs = (runtime->silence_start + runtime->silence_filled) % runtime->buffer_size;
-
while (frames > 0)
{
+
do
{
transfer = ofs + frames > runtime->buffer_size ? runtime->buffer_size - ofs : frames;
err = fill_silence_frames(substream, ofs, transfer);
snd_BUG_ON(err < 0);
runtime->silence_filled += transfer;
frames -= transfer;
ofs = 0;
- }
+ }
while (frames > 0);
snd_pcm_dma_buffer_sync(substream, SNDRV_DMA_SYNC_DEVICE);
}