diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2022-01-28 15:36:20 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-01-28 15:59:39 +0000 |
commit | 2acfab7101140e93928a61ca48d7e442aa538dd7 (patch) | |
tree | c749bd70c0db01d678fcd6ab1cdbf21948982a1f /sound/soc/sof/ipc.c | |
parent | 73a548bd1fa3cbe5d18026230a34c1f058257536 (diff) | |
download | linux-stable-2acfab7101140e93928a61ca48d7e442aa538dd7.tar.gz linux-stable-2acfab7101140e93928a61ca48d7e442aa538dd7.tar.bz2 linux-stable-2acfab7101140e93928a61ca48d7e442aa538dd7.zip |
ASoC: SOF: ipc: Do not allocate buffer for msg_data
The sof_ipc_tx_message does not have support for async operations.
There is no need to allocate a buffer and copy each message to it to be
sent to the DSP, we can use the passed message data pointer directly.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Reviewed-by: Rander Wang <rander.wang@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20220128133620.9411-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ipc.c')
-rw-r--r-- | sound/soc/sof/ipc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index ec51daed8b31..16a0d7a059f3 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -321,7 +321,7 @@ static int sof_ipc_tx_message_unlocked(struct snd_sof_ipc *ipc, msg = &ipc->msg; /* attach message data */ - memcpy(msg->msg_data, msg_data, msg_bytes); + msg->msg_data = msg_data; msg->msg_size = msg_bytes; msg->reply_size = reply_bytes; @@ -1003,9 +1003,6 @@ int sof_ipc_init_msg_memory(struct snd_sof_dev *sdev) struct snd_sof_ipc_msg *msg; msg = &sdev->ipc->msg; - msg->msg_data = devm_kzalloc(sdev->dev, SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL); - if (!msg->msg_data) - return -ENOMEM; msg->reply_data = devm_kzalloc(sdev->dev, SOF_IPC_MSG_MAX_SIZE, GFP_KERNEL); if (!msg->reply_data) |