Commit 8a0eb06e authored by Seppo Ingalsuo's avatar Seppo Ingalsuo Committed by Mark Brown

ASoC: SOF: IPC3 topology: Print the conflicting bytes sizes

The error "Conflict in bytes vs. priv size." is too brief. With
the printed sizes it's a lot easier to find the size issue in
for binary control if such happens.
Signed-off-by: default avatarSeppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20221216115350.28260-1-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b66cd835
......@@ -1651,6 +1651,7 @@ static int sof_ipc3_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route *
static int sof_ipc3_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol)
{
struct sof_ipc_ctrl_data *cdata;
size_t priv_size_check;
int ret;
if (scontrol->max_size < (sizeof(*cdata) + sizeof(struct sof_abi_hdr))) {
......@@ -1694,8 +1695,10 @@ static int sof_ipc3_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_
goto err;
}
if (cdata->data->size + sizeof(struct sof_abi_hdr) != scontrol->priv_size) {
dev_err(sdev->dev, "Conflict in bytes vs. priv size.\n");
priv_size_check = cdata->data->size + sizeof(struct sof_abi_hdr);
if (priv_size_check != scontrol->priv_size) {
dev_err(sdev->dev, "Conflict in bytes (%zu) vs. priv size (%zu).\n",
priv_size_check, scontrol->priv_size);
ret = -EINVAL;
goto err;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment