[PATCH 11/11] ASoC: SOF: Remove redundant return statements

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Wed Mar 30 22:19:26 CEST 2022


From: tangmeng <tangmeng at uniontech.com>

After the free PCM action is executed, no matter what
the return result is, it will return directly in sof_pcm_trigger.
So the return statement here is redundant.

Signed-off-by: tangmeng <tangmeng at uniontech.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta at nxp.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi at linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
 sound/soc/sof/pcm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/sound/soc/sof/pcm.c b/sound/soc/sof/pcm.c
index 658cd8966c9a..b5cbc8b5c0ee 100644
--- a/sound/soc/sof/pcm.c
+++ b/sound/soc/sof/pcm.c
@@ -347,12 +347,9 @@ static int sof_pcm_trigger(struct snd_soc_component *component,
 		snd_sof_pcm_platform_trigger(sdev, substream, cmd);
 
 	/* free PCM if reset_hw_params is set and the STOP IPC is successful */
-	if (!ret && reset_hw_params) {
+	if (!ret && reset_hw_params)
 		ret = sof_pcm_stream_free(sdev, substream, spcm, substream->stream,
 					  free_widget_list);
-		if (ret < 0)
-			return ret;
-	}
 
 	return ret;
 }
-- 
2.25.1



More information about the Alsa-devel mailing list