ASoC: SOF: ipc: Use msg->reply_data directly in snd_sof_ipc_get_reply()
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 30 Mar 2022 20:19:23 +0000 (13:19 -0700)
committerMark Brown <broonie@kernel.org>
Mon, 4 Apr 2022 07:39:08 +0000 (08:39 +0100)
commit5db8eb5b9e35c712cc63fcebf04c80ace9812961
tree4916e637854a9f3d5872a1c7a5c086897daf91b2
parent249ee180874dd48a809caf70981b2aa800329d27
ASoC: SOF: ipc: Use msg->reply_data directly in snd_sof_ipc_get_reply()

Instead of using a local reply to first read out the header from the
mailbox then memcpy it or read it again to msg->reply_data, read it
directly to it's final place from the start.

If we received an error we do not need to do a memcpy anymore.
If the reply is reporting a success then we don not need to read the reply
again from the mailbox if the reply_size equals to the already read header
size.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20220330201926.1330402-9-ranjani.sridharan@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/ipc.c