linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: tegra: Constify static snd_soc_dai_ops structs
@ 2021-09-22 20:54 Rikard Falkeborn
  2021-09-23  4:20 ` Sameer Pujar
  2021-09-27 17:45 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Rikard Falkeborn @ 2021-09-22 20:54 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Sameer Pujar
  Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
	alsa-devel, linux-tegra, linux-kernel, Rikard Falkeborn

The only usage of these is to assign their address to the ops field in
the snd_soc_dai_driver struct, which is a pointer to const. Make them
const to allow the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
---
 sound/soc/tegra/tegra210_adx.c   | 4 ++--
 sound/soc/tegra/tegra210_amx.c   | 4 ++--
 sound/soc/tegra/tegra210_mixer.c | 4 ++--
 sound/soc/tegra/tegra210_mvc.c   | 2 +-
 sound/soc/tegra/tegra210_sfc.c   | 4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sound/soc/tegra/tegra210_adx.c b/sound/soc/tegra/tegra210_adx.c
index 78d660447bb1..d7c7849c2f92 100644
--- a/sound/soc/tegra/tegra210_adx.c
+++ b/sound/soc/tegra/tegra210_adx.c
@@ -206,12 +206,12 @@ static int tegra210_adx_put_byte_map(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_soc_dai_ops tegra210_adx_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_adx_in_dai_ops = {
 	.hw_params	= tegra210_adx_in_hw_params,
 	.startup	= tegra210_adx_startup,
 };
 
-static struct snd_soc_dai_ops tegra210_adx_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_adx_out_dai_ops = {
 	.hw_params	= tegra210_adx_out_hw_params,
 };
 
diff --git a/sound/soc/tegra/tegra210_amx.c b/sound/soc/tegra/tegra210_amx.c
index 83176e1663ab..af9bddfc3120 100644
--- a/sound/soc/tegra/tegra210_amx.c
+++ b/sound/soc/tegra/tegra210_amx.c
@@ -241,12 +241,12 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_soc_dai_ops tegra210_amx_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_amx_out_dai_ops = {
 	.hw_params	= tegra210_amx_out_hw_params,
 	.startup	= tegra210_amx_startup,
 };
 
-static struct snd_soc_dai_ops tegra210_amx_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_amx_in_dai_ops = {
 	.hw_params	= tegra210_amx_in_hw_params,
 };
 
diff --git a/sound/soc/tegra/tegra210_mixer.c b/sound/soc/tegra/tegra210_mixer.c
index 53fcd8f6605a..55e61776c565 100644
--- a/sound/soc/tegra/tegra210_mixer.c
+++ b/sound/soc/tegra/tegra210_mixer.c
@@ -283,11 +283,11 @@ static int tegra210_mixer_out_hw_params(struct snd_pcm_substream *substream,
 					    dai->id - TEGRA210_MIXER_RX_MAX);
 }
 
-static struct snd_soc_dai_ops tegra210_mixer_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_mixer_out_dai_ops = {
 	.hw_params	= tegra210_mixer_out_hw_params,
 };
 
-static struct snd_soc_dai_ops tegra210_mixer_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_mixer_in_dai_ops = {
 	.hw_params	= tegra210_mixer_in_hw_params,
 };
 
diff --git a/sound/soc/tegra/tegra210_mvc.c b/sound/soc/tegra/tegra210_mvc.c
index 3646ce9b0fd1..7b9c7006e419 100644
--- a/sound/soc/tegra/tegra210_mvc.c
+++ b/sound/soc/tegra/tegra210_mvc.c
@@ -387,7 +387,7 @@ static int tegra210_mvc_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-static struct snd_soc_dai_ops tegra210_mvc_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_mvc_dai_ops = {
 	.hw_params	= tegra210_mvc_hw_params,
 };
 
diff --git a/sound/soc/tegra/tegra210_sfc.c b/sound/soc/tegra/tegra210_sfc.c
index 260dca6f6d25..dc477ee1b82c 100644
--- a/sound/soc/tegra/tegra210_sfc.c
+++ b/sound/soc/tegra/tegra210_sfc.c
@@ -3287,12 +3287,12 @@ static int tegra210_sfc_put_control(struct snd_kcontrol *kcontrol,
 	return 1;
 }
 
-static struct snd_soc_dai_ops tegra210_sfc_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_sfc_in_dai_ops = {
 	.hw_params	= tegra210_sfc_in_hw_params,
 	.startup	= tegra210_sfc_startup,
 };
 
-static struct snd_soc_dai_ops tegra210_sfc_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_sfc_out_dai_ops = {
 	.hw_params	= tegra210_sfc_out_hw_params,
 };
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: tegra: Constify static snd_soc_dai_ops structs
  2021-09-22 20:54 [PATCH] ASoC: tegra: Constify static snd_soc_dai_ops structs Rikard Falkeborn
@ 2021-09-23  4:20 ` Sameer Pujar
  2021-09-27 17:45 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Sameer Pujar @ 2021-09-23  4:20 UTC (permalink / raw)
  To: Rikard Falkeborn, Liam Girdwood, Mark Brown
  Cc: Jaroslav Kysela, Takashi Iwai, Thierry Reding, Jonathan Hunter,
	alsa-devel, linux-tegra, linux-kernel



On 9/23/2021 2:24 AM, Rikard Falkeborn wrote:
> The only usage of these is to assign their address to the ops field in
> the snd_soc_dai_driver struct, which is a pointer to const. Make them
> const to allow the compiler to put them in read-only memory.
>
> Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
> ---
>   sound/soc/tegra/tegra210_adx.c   | 4 ++--
>   sound/soc/tegra/tegra210_amx.c   | 4 ++--
>   sound/soc/tegra/tegra210_mixer.c | 4 ++--
>   sound/soc/tegra/tegra210_mvc.c   | 2 +-
>   sound/soc/tegra/tegra210_sfc.c   | 4 ++--
>   5 files changed, 9 insertions(+), 9 deletions(-)
>

Thank you Rikard for the patch.

Acked-by: Sameer Pujar <spujar@nvidia.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: tegra: Constify static snd_soc_dai_ops structs
  2021-09-22 20:54 [PATCH] ASoC: tegra: Constify static snd_soc_dai_ops structs Rikard Falkeborn
  2021-09-23  4:20 ` Sameer Pujar
@ 2021-09-27 17:45 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-09-27 17:45 UTC (permalink / raw)
  To: Rikard Falkeborn, Liam Girdwood, Sameer Pujar
  Cc: Mark Brown, alsa-devel, Takashi Iwai, linux-kernel, linux-tegra,
	Jonathan Hunter, Jaroslav Kysela, Thierry Reding

On Wed, 22 Sep 2021 22:54:38 +0200, Rikard Falkeborn wrote:
> The only usage of these is to assign their address to the ops field in
> the snd_soc_dai_driver struct, which is a pointer to const. Make them
> const to allow the compiler to put them in read-only memory.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tegra: Constify static snd_soc_dai_ops structs
      commit: 313fab4820f3b1040bc1bd27cd4c7f69572951e8

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-27 17:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 20:54 [PATCH] ASoC: tegra: Constify static snd_soc_dai_ops structs Rikard Falkeborn
2021-09-23  4:20 ` Sameer Pujar
2021-09-27 17:45 ` Mark Brown

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 NNTP newsgroup(s).