From: Peter Ujfalusi Date: Tue, 8 Oct 2024 11:09:31 +0000 (+0300) Subject: ASoC: SOF: ipc4-topology: Remove redundant check in sof_ipc4_init_input_audio_fmt() X-Git-Tag: v6.13-rc1~123^2~2^2~105^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d9635b57b1bbbece2a8d30103fcd1ebfbbe0178;p=thirdparty%2Flinux.git 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 Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://patch.msgid.link/20241008110936.22534-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index af5eea853745d..1f10926921d54 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; }