summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Blum <thorsten.blum@linux.dev>2025-02-24 23:12:12 +0100
committerMark Brown <broonie@kernel.org>2025-02-25 13:19:24 +0000
commit8fd0e127d8da856e34391399df40b33af2b307e0 (patch)
treecdd457ed6695daf458483e49832ce9e510e5c210
parent63d93f4d0f38fbb95a55729fbd2cc4920743931c (diff)
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>
-rw-r--r--sound/soc/amd/acp/acp70.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c
index ef3f6504bc7f..7f4ec3bfaeab 100644
--- a/sound/soc/amd/acp/acp70.c
+++ b/sound/soc/amd/acp/acp70.c
@@ -230,18 +230,16 @@ static int __maybe_unused acp70_pcm_resume(struct device *dev)
spin_lock(&adata->acp_lock);
list_for_each_entry(stream, &adata->stream_list, list) {
- if (stream) {
- substream = stream->substream;
- if (substream && substream->runtime) {
- buf_in_frames = (substream->runtime->buffer_size);
- buf_size = frames_to_bytes(substream->runtime, buf_in_frames);
- config_pte_for_stream(adata, stream);
- config_acp_dma(adata, stream, buf_size);
- if (stream->dai_id)
- restore_acp_i2s_params(substream, adata, stream);
- else
- restore_acp_pdm_params(substream, adata);
- }
+ substream = stream->substream;
+ if (substream && substream->runtime) {
+ buf_in_frames = (substream->runtime->buffer_size);
+ buf_size = frames_to_bytes(substream->runtime, buf_in_frames);
+ config_pte_for_stream(adata, stream);
+ config_acp_dma(adata, stream, buf_size);
+ if (stream->dai_id)
+ restore_acp_i2s_params(substream, adata, stream);
+ else
+ restore_acp_pdm_params(substream, adata);
}
}
spin_unlock(&adata->acp_lock);