ASoC: SOF: ipc4-topology: Remove redundant check in sof_ipc4_init_input_audio_fmt()

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>
Link: https://patch.msgid.link/20241008110936.22534-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Peter Ujfalusi 2024-10-08 14:09:31 +03:00 committed by Mark Brown
parent 3b54c1cd69
commit 2d9635b57b
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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;
}