Kernel-Janitors Archive mirror
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, cezary.rojewski@intel.com,
	pierre-louis.bossart@linux.intel.com,
	peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com,
	ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com,
	srinivas.kandagatla@linaro.org, bgoswami@quicinc.com,
	daniel.baluta@nxp.com
Cc: linux-sound@vger.kernel.org, alsa-devel@alsa-project.org,
	sound-open-firmware@alsa-project.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 1/6] ASoC: topology: Constify an argument of snd_soc_tplg_component_load()
Date: Tue, 14 May 2024 09:23:56 +0200	[thread overview]
Message-ID: <9a34ea33-1294-4356-b9c4-295709a86cd2@linux.intel.com> (raw)
In-Reply-To: <f2f983e791d7f941a95556bb147f426a345d84d4.1715526069.git.christophe.jaillet@wanadoo.fr>

On 5/13/2024 7:37 PM, Christophe JAILLET wrote:
> snd_soc_tplg_component_load() does not modify its "*ops" argument. It
> only read some values and stores it in "soc_tplg.ops".
> 
> This argument and the ops field in "struct soc_tplg" can be made const.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   include/sound/soc-topology.h | 2 +-
>   sound/soc/soc-topology.c     | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/sound/soc-topology.h b/include/sound/soc-topology.h
> index f055c6917f6c..1eedd203ac29 100644
> --- a/include/sound/soc-topology.h
> +++ b/include/sound/soc-topology.h
> @@ -178,7 +178,7 @@ static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr)
>   
>   /* Dynamic Object loading and removal for component drivers */
>   int snd_soc_tplg_component_load(struct snd_soc_component *comp,
> -	struct snd_soc_tplg_ops *ops, const struct firmware *fw);
> +	const struct snd_soc_tplg_ops *ops, const struct firmware *fw);
>   int snd_soc_tplg_component_remove(struct snd_soc_component *comp);
>   
>   /* Binds event handlers to dynamic widgets */
> diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
> index 90ca37e008b3..b00ec01361c2 100644
> --- a/sound/soc/soc-topology.c
> +++ b/sound/soc/soc-topology.c
> @@ -73,7 +73,7 @@ struct soc_tplg {
>   	int bytes_ext_ops_count;
>   
>   	/* optional fw loading callbacks to component drivers */
> -	struct snd_soc_tplg_ops *ops;
> +	const struct snd_soc_tplg_ops *ops;
>   };
>   
>   /* check we dont overflow the data for this control chunk */
> @@ -2334,7 +2334,7 @@ static int soc_tplg_load(struct soc_tplg *tplg)
>   
>   /* load audio component topology from "firmware" file */
>   int snd_soc_tplg_component_load(struct snd_soc_component *comp,
> -	struct snd_soc_tplg_ops *ops, const struct firmware *fw)
> +	const struct snd_soc_tplg_ops *ops, const struct firmware *fw)
>   {
>   	struct soc_tplg tplg;
>   	int ret;

Yes, makes sense to me.

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>

  parent reply	other threads:[~2024-05-14  7:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 17:37 [PATCH 1/6] ASoC: topology: Constify an argument of snd_soc_tplg_component_load() Christophe JAILLET
2024-05-13 17:37 ` [PATCH 2/6] ASoC: Intel: avs: Constify struct snd_soc_tplg_ops Christophe JAILLET
2024-05-14  7:24   ` Amadeusz Sławiński
2024-05-13 17:37 ` [PATCH 3/6] ASoC: qdsp6: audioreach: " Christophe JAILLET
2024-05-13 17:37 ` [PATCH 4/6] ASoC: Intel: Skylake: " Christophe JAILLET
2024-05-14  7:24   ` Amadeusz Sławiński
2024-05-13 17:37 ` [PATCH 5/6] ASoC: SOF: topology: " Christophe JAILLET
2024-05-13 17:37 ` [PATCH 6/6] const_structs.checkpatch: add snd_soc_tplg_ops Christophe JAILLET
2024-05-14  7:23 ` Amadeusz Sławiński [this message]
2024-05-14 10:21 ` [PATCH 1/6] ASoC: topology: Constify an argument of snd_soc_tplg_component_load() Mark Brown
2024-05-18  8:34   ` Christophe JAILLET
2024-05-20 13:24     ` Mark Brown
2024-05-20 21:31       ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a34ea33-1294-4356-b9c4-295709a86cd2@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=daniel.baluta@nxp.com \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=sound-open-firmware@alsa-project.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).