ALSA: dummy: Move pcm_substreams check out of the loop
PATCH 1/1 ALSA: dummy: Move pcm_substreams check out of the loop
From: bui duc phuc <[email protected]>
The pcm_substreams[dev] range check does not depend on the loop index. Do it once before the loop instead of on every iteration.
No functional change.
Signed-off-by bui duc phuc <[email protected]>
--- sound/drivers/dummy.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
sound/drivers/dummy.c +6 -4
@@ -1063,11 +1063,13 @@ static int snd_dummy_probe(struct platform_device *devptr)break ; } } + +if (pcm_substreams[dev] <1 ) + pcm_substreams[dev] =1 ; +if (pcm_substreams[dev] >MAX_PCM_SUBSTREAMS ) + pcm_substreams[dev] =MAX_PCM_SUBSTREAMS ; +for (idx =0 ; idx <MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) { -if (pcm_substreams[dev] <1 ) - pcm_substreams[dev] =1 ; -if (pcm_substreams[dev] >MAX_PCM_SUBSTREAMS ) - pcm_substreams[dev] =MAX_PCM_SUBSTREAMS ; err =snd_card_dummy_pcm (dummy, idx, pcm_substreams[dev]);if (err <0 )return err;
Signature · 1 line
2.43.0
Takashi Iwai
AppliedQuoted 9 lines · On Mon, 28 Sep 2026 04:18:23 +0200, [email protected] wrote:
From: bui duc phuc <[email protected]>
The pcm_substreams[dev] range check does not depend on the loop index. Do it once before the loop instead of on every iteration.
No functional change.
Signed-off-by bui duc phuc <[email protected]>
Applied to for-next branch. Thanks.
Takashi