[<prev] [next>] [day] [month] [year] [list]
Message-ID: <bda284d2-05c4-47ab-9611-a58a70fe58ae@moroto.mountain>
Date: Mon, 27 Nov 2023 15:56:22 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Liam Girdwood <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>,
Syed Saba Kareem <Syed.SabaKareem@....com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Yang Li <yang.lee@...ux.alibaba.com>,
linux-sound@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH] ASoC: amd: acp: Remove unnecessary NULL check
The list iterator cannot be NULL so there is no need to check. Delete
the check and pull the code in a tab.
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
sound/soc/amd/acp/acp70.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/sound/soc/amd/acp/acp70.c b/sound/soc/amd/acp/acp70.c
index 0d7cdd4017e5..f65955215487 100644
--- a/sound/soc/amd/acp/acp70.c
+++ b/sound/soc/amd/acp/acp70.c
@@ -215,18 +215,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);
--
2.42.0
Powered by blists - more mailing lists