diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-10-30 12:03:51 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-11-13 04:26:16 +0300 |
commit | 601cc04c9d73ed728b29eaddb29ae13b48b03ce7 (patch) | |
tree | b92ae67dc89dfa38797069218d549fe3152b634d /sound/soc/amd | |
parent | dc29d3d253f1f3513a916f0b4271569223860c71 (diff) | |
download | linux-601cc04c9d73ed728b29eaddb29ae13b48b03ce7.tar.xz |
ASoC: amd: acp: remove unnecessary NULL check
The list iterator in a list_for_each_entry() loop can never be NULL.
Remove the check and pull the code in a tab.
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/e376a712-e0c6-446f-9e0b-c444dd795cbb@moroto.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/amd')
-rw-r--r-- | sound/soc/amd/acp/acp63.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sound/soc/amd/acp/acp63.c b/sound/soc/amd/acp/acp63.c index b871a216a6af..4d342441a650 100644 --- a/sound/soc/amd/acp/acp63.c +++ b/sound/soc/amd/acp/acp63.c @@ -283,18 +283,16 @@ static int __maybe_unused acp63_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); |