Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: amd: acp: acp70: Remove unnecessary if-check

Since list_for_each_entry() expects the list to not be empty, the
iterator variable cannot be NULL and the unnecessary if-check can be
removed. Remove it and indent the code accordingly.

Compile-tested only.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250224221214.199849-2-thorsten.blum@linux.dev
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Thorsten Blum and committed by
Mark Brown
8fd0e127 63d93f4d

+10 -12
+10 -12
sound/soc/amd/acp/acp70.c
··· 230 230 231 231 spin_lock(&adata->acp_lock); 232 232 list_for_each_entry(stream, &adata->stream_list, list) { 233 - if (stream) { 234 - substream = stream->substream; 235 - if (substream && substream->runtime) { 236 - buf_in_frames = (substream->runtime->buffer_size); 237 - buf_size = frames_to_bytes(substream->runtime, buf_in_frames); 238 - config_pte_for_stream(adata, stream); 239 - config_acp_dma(adata, stream, buf_size); 240 - if (stream->dai_id) 241 - restore_acp_i2s_params(substream, adata, stream); 242 - else 243 - restore_acp_pdm_params(substream, adata); 244 - } 233 + substream = stream->substream; 234 + if (substream && substream->runtime) { 235 + buf_in_frames = (substream->runtime->buffer_size); 236 + buf_size = frames_to_bytes(substream->runtime, buf_in_frames); 237 + config_pte_for_stream(adata, stream); 238 + config_acp_dma(adata, stream, buf_size); 239 + if (stream->dai_id) 240 + restore_acp_i2s_params(substream, adata, stream); 241 + else 242 + restore_acp_pdm_params(substream, adata); 245 243 } 246 244 } 247 245 spin_unlock(&adata->acp_lock);