diff mbox series

[3/8] ASoC: SOF: ipc4-topology: Remove redundant check in sof_ipc4_init_input_audio_fmt()

Message ID 20241008110936.22534-4-peter.ujfalusi@linux.intel.com (mailing list archive)
State Accepted
Commit 2d9635b57b1bbbece2a8d30103fcd1ebfbbe0178
Headers show
Series ASoC: SOF: ipc4-topology: Rework the module audio format prints | expand

Commit Message

Peter Ujfalusi Oct. 8, 2024, 11:09 a.m. UTC
At label in_fmt the if (pin_fmts_size && i < pin_fmts_size) is guarantied
to be true all the time, drop the check completely.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/ipc4-topology.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index af5eea853745..1f10926921d5 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -1320,16 +1320,14 @@  static int sof_ipc4_init_input_audio_fmt(struct snd_sof_dev *sdev,
 
 in_fmt:
 	/* copy input format */
-	if (pin_fmts_size && i < pin_fmts_size) {
-		memcpy(&base_config->audio_fmt, &pin_fmts[i].audio_fmt,
-		       sizeof(struct sof_ipc4_audio_format));
+	memcpy(&base_config->audio_fmt, &pin_fmts[i].audio_fmt,
+	       sizeof(struct sof_ipc4_audio_format));
 
-		/* set base_cfg ibs/obs */
-		base_config->ibs = pin_fmts[i].buffer_size;
+	/* set base_cfg ibs/obs */
+	base_config->ibs = pin_fmts[i].buffer_size;
 
-		dev_dbg(sdev->dev, "Init input audio formats for %s\n", swidget->widget->name);
-		sof_ipc4_dbg_audio_format(sdev->dev, &pin_fmts[i], 1);
-	}
+	dev_dbg(sdev->dev, "Init input audio formats for %s\n", swidget->widget->name);
+	sof_ipc4_dbg_audio_format(sdev->dev, &pin_fmts[i], 1);
 
 	return i;
 }