diff mbox series

[1/2] ASoC: SOF: ipc: Add no reply inline calls

Message ID 20230406155026.18723-2-pierre-louis.bossart@linux.intel.com
State Superseded
Headers show
Series ASoC: SOF: add no_reply IPC calls | expand

Commit Message

Pierre-Louis Bossart April 6, 2023, 3:50 p.m. UTC
From: Curtis Malainey <cujomalainey@chromium.org>

95% of the calls inside SOF to TX an IPC don't care about a reply. Yet
the previous commit cleaned up a bunch of replies that were being
populated and then thrown away. This adds some functions so users who do
not need replies don't feel obligated to provide the space to the API.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
 sound/soc/sof/sof-client.h |  4 ++++
 sound/soc/sof/sof-priv.h   | 10 ++++++++++
 2 files changed, 14 insertions(+)

Comments

Mark Brown April 6, 2023, 4 p.m. UTC | #1
On Thu, Apr 06, 2023 at 10:50:25AM -0500, Pierre-Louis Bossart wrote:

> +static inline int sof_client_ipc_tx_message_no_reply(struct sof_client_dev *cdev, void *ipc_msg)
> +{
> +	return sof_client_ipc_tx_message(cdev, ipc_msg, NULL, 0);
> +}
>  int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,

This looks like it's missing some blank lines but that appears to be the
existing idiom so let's not mind for now...
diff mbox series

Patch

diff --git a/sound/soc/sof/sof-client.h b/sound/soc/sof/sof-client.h
index 2589714eaa91..10571d1ea9a7 100644
--- a/sound/soc/sof/sof-client.h
+++ b/sound/soc/sof/sof-client.h
@@ -39,6 +39,10 @@  struct sof_client_dev {
 
 int sof_client_ipc_tx_message(struct sof_client_dev *cdev, void *ipc_msg,
 			      void *reply_data, size_t reply_bytes);
+static inline int sof_client_ipc_tx_message_no_reply(struct sof_client_dev *cdev, void *ipc_msg)
+{
+	return sof_client_ipc_tx_message(cdev, ipc_msg, NULL, 0);
+}
 int sof_client_ipc_set_get_data(struct sof_client_dev *cdev, void *ipc_msg,
 				bool set);
 
diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
index 1170989bea57..cd4f6ac126ec 100644
--- a/sound/soc/sof/sof-priv.h
+++ b/sound/soc/sof/sof-priv.h
@@ -711,10 +711,20 @@  static inline void snd_sof_ipc_msgs_rx(struct snd_sof_dev *sdev)
 }
 int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
 		       void *reply_data, size_t reply_bytes);
+static inline int sof_ipc_tx_message_no_reply(struct snd_sof_ipc *ipc, void *msg_data,
+					      size_t msg_bytes)
+{
+	return sof_ipc_tx_message(ipc, msg_data, msg_bytes, NULL, 0);
+}
 int sof_ipc_set_get_data(struct snd_sof_ipc *ipc, void *msg_data,
 			 size_t msg_bytes, bool set);
 int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes,
 			     void *reply_data, size_t reply_bytes);
+static inline int sof_ipc_tx_message_no_pm_no_reply(struct snd_sof_ipc *ipc, void *msg_data,
+						    size_t msg_bytes)
+{
+	return sof_ipc_tx_message_no_pm(ipc, msg_data, msg_bytes, NULL, 0);
+}
 int sof_ipc_send_msg(struct snd_sof_dev *sdev, void *msg_data, size_t msg_bytes,
 		     size_t reply_bytes);