[PATCH] ASoC: samsung: Constify static snd_soc_ops
These are only assigned to the ops field in the snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops. 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/samsung/aries_wm8994.c | 2 +- sound/soc/samsung/arndale.c | 4 ++-- sound/soc/samsung/h1940_uda1380.c | 2 +- sound/soc/samsung/littlemill.c | 2 +- sound/soc/samsung/midas_wm1811.c | 2 +- sound/soc/samsung/neo1973_wm8753.c | 4 ++-- sound/soc/samsung/rx1950_uda1380.c | 2 +- sound/soc/samsung/smartq_wm8987.c | 2 +- sound/soc/samsung/smdk_wm8580.c | 2 +- sound/soc/samsung/smdk_wm8994.c | 2 +- sound/soc/samsung/smdk_wm8994pcm.c | 2 +- sound/soc/samsung/tm2_wm5110.c | 6 +++--- sound/soc/samsung/tobermory.c | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c index 0ac5956ba270..313ab650f8d9 100644 --- a/sound/soc/samsung/aries_wm8994.c +++ b/sound/soc/samsung/aries_wm8994.c @@ -310,7 +310,7 @@ static int aries_hw_free(struct snd_pcm_substream *substream) /* * Main DAI operations */ -static struct snd_soc_ops aries_ops = { +static const struct snd_soc_ops aries_ops = { .hw_params = aries_hw_params, .hw_free = aries_hw_free, }; diff --git a/sound/soc/samsung/arndale.c b/sound/soc/samsung/arndale.c index 28587375813a..606ac5e33a8e 100644 --- a/sound/soc/samsung/arndale.c +++ b/sound/soc/samsung/arndale.c @@ -48,7 +48,7 @@ static int arndale_rt5631_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops arndale_rt5631_ops = { +static const struct snd_soc_ops arndale_rt5631_ops = { .hw_params = arndale_rt5631_hw_params, };
@@ -80,7 +80,7 @@ static int arndale_wm1811_hw_params(struct snd_pcm_substream *substream, rclk + 1, SND_SOC_CLOCK_IN); }
-static struct snd_soc_ops arndale_wm1811_ops = { +static const struct snd_soc_ops arndale_wm1811_ops = { .hw_params = arndale_wm1811_hw_params, };
diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index 8aa78ff640f5..c994e67d1eaf 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c @@ -112,7 +112,7 @@ static int h1940_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops h1940_ops = { +static const struct snd_soc_ops h1940_ops = { .startup = h1940_startup, .hw_params = h1940_hw_params, }; diff --git a/sound/soc/samsung/littlemill.c b/sound/soc/samsung/littlemill.c index a1ff1400857e..390f2dd735ad 100644 --- a/sound/soc/samsung/littlemill.c +++ b/sound/soc/samsung/littlemill.c @@ -130,7 +130,7 @@ static int littlemill_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops littlemill_ops = { +static const struct snd_soc_ops littlemill_ops = { .hw_params = littlemill_hw_params, };
diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c index 1f9a553edf19..a2019535a0b1 100644 --- a/sound/soc/samsung/midas_wm1811.c +++ b/sound/soc/samsung/midas_wm1811.c @@ -129,7 +129,7 @@ static int midas_aif1_hw_params(struct snd_pcm_substream *substream, return midas_start_fll1(rtd, pll_out); }
-static struct snd_soc_ops midas_aif1_ops = { +static const struct snd_soc_ops midas_aif1_ops = { .hw_params = midas_aif1_hw_params, };
diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index 9266070e0181..c98b68567a89 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c @@ -106,7 +106,7 @@ static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream) /* * Neo1973 WM8753 HiFi DAI opserations. */ -static struct snd_soc_ops neo1973_hifi_ops = { +static const struct snd_soc_ops neo1973_hifi_ops = { .hw_params = neo1973_hifi_hw_params, .hw_free = neo1973_hifi_hw_free, }; @@ -158,7 +158,7 @@ static int neo1973_voice_hw_free(struct snd_pcm_substream *substream) return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0, 0); }
-static struct snd_soc_ops neo1973_voice_ops = { +static const struct snd_soc_ops neo1973_voice_ops = { .hw_params = neo1973_voice_hw_params, .hw_free = neo1973_voice_hw_free, }; diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 400a7f77c711..6ea1c8cc9167 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c @@ -62,7 +62,7 @@ static struct snd_soc_jack_gpio hp_jack_gpios[] = { }, };
-static struct snd_soc_ops rx1950_ops = { +static const struct snd_soc_ops rx1950_ops = { .startup = rx1950_startup, .hw_params = rx1950_hw_params, }; diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c index c95629becbc3..cee39ad16667 100644 --- a/sound/soc/samsung/smartq_wm8987.c +++ b/sound/soc/samsung/smartq_wm8987.c @@ -70,7 +70,7 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream, /* * SmartQ WM8987 HiFi DAI operations. */ -static struct snd_soc_ops smartq_hifi_ops = { +static const struct snd_soc_ops smartq_hifi_ops = { .hw_params = smartq_hifi_hw_params, };
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c index ed753a2f202e..78703d095a6f 100644 --- a/sound/soc/samsung/smdk_wm8580.c +++ b/sound/soc/samsung/smdk_wm8580.c @@ -86,7 +86,7 @@ static int smdk_hw_params(struct snd_pcm_substream *substream, /* * SMDK WM8580 DAI operations. */ -static struct snd_soc_ops smdk_ops = { +static const struct snd_soc_ops smdk_ops = { .hw_params = smdk_hw_params, };
diff --git a/sound/soc/samsung/smdk_wm8994.c b/sound/soc/samsung/smdk_wm8994.c index 39a7a449f554..7661b637946d 100644 --- a/sound/soc/samsung/smdk_wm8994.c +++ b/sound/soc/samsung/smdk_wm8994.c @@ -73,7 +73,7 @@ static int smdk_hw_params(struct snd_pcm_substream *substream, /* * SMDK WM8994 DAI operations. */ -static struct snd_soc_ops smdk_ops = { +static const struct snd_soc_ops smdk_ops = { .hw_params = smdk_hw_params, };
diff --git a/sound/soc/samsung/smdk_wm8994pcm.c b/sound/soc/samsung/smdk_wm8994pcm.c index a01640576f71..029448f5bedb 100644 --- a/sound/soc/samsung/smdk_wm8994pcm.c +++ b/sound/soc/samsung/smdk_wm8994pcm.c @@ -85,7 +85,7 @@ static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops smdk_wm8994_pcm_ops = { +static const struct snd_soc_ops smdk_wm8994_pcm_ops = { .hw_params = smdk_wm8994_pcm_hw_params, };
diff --git a/sound/soc/samsung/tm2_wm5110.c b/sound/soc/samsung/tm2_wm5110.c index 84c2c63d5a87..a2c77e6defec 100644 --- a/sound/soc/samsung/tm2_wm5110.c +++ b/sound/soc/samsung/tm2_wm5110.c @@ -126,7 +126,7 @@ static int tm2_aif1_hw_params(struct snd_pcm_substream *substream, return tm2_start_sysclk(rtd->card); }
-static struct snd_soc_ops tm2_aif1_ops = { +static const struct snd_soc_ops tm2_aif1_ops = { .hw_params = tm2_aif1_hw_params, };
@@ -200,7 +200,7 @@ static int tm2_aif2_hw_free(struct snd_pcm_substream *substream) return ret; }
-static struct snd_soc_ops tm2_aif2_ops = { +static const struct snd_soc_ops tm2_aif2_ops = { .hw_params = tm2_aif2_hw_params, .hw_free = tm2_aif2_hw_free, }; @@ -254,7 +254,7 @@ static int tm2_hdmi_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops tm2_hdmi_ops = { +static const struct snd_soc_ops tm2_hdmi_ops = { .hw_params = tm2_hdmi_hw_params, };
diff --git a/sound/soc/samsung/tobermory.c b/sound/soc/samsung/tobermory.c index c962d2c2a7f7..15223d860cb7 100644 --- a/sound/soc/samsung/tobermory.c +++ b/sound/soc/samsung/tobermory.c @@ -105,7 +105,7 @@ static int tobermory_hw_params(struct snd_pcm_substream *substream, return 0; }
-static struct snd_soc_ops tobermory_ops = { +static const struct snd_soc_ops tobermory_ops = { .hw_params = tobermory_hw_params, };
On 28/07/2021 19:25, Rikard Falkeborn wrote:
These are only assigned to the ops field in the snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops. 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/samsung/aries_wm8994.c | 2 +- sound/soc/samsung/arndale.c | 4 ++-- sound/soc/samsung/h1940_uda1380.c | 2 +- sound/soc/samsung/littlemill.c | 2 +- sound/soc/samsung/midas_wm1811.c | 2 +- sound/soc/samsung/neo1973_wm8753.c | 4 ++-- sound/soc/samsung/rx1950_uda1380.c | 2 +- sound/soc/samsung/smartq_wm8987.c | 2 +- sound/soc/samsung/smdk_wm8580.c | 2 +- sound/soc/samsung/smdk_wm8994.c | 2 +- sound/soc/samsung/smdk_wm8994pcm.c | 2 +- sound/soc/samsung/tm2_wm5110.c | 6 +++--- sound/soc/samsung/tobermory.c | 2 +- 13 files changed, 17 insertions(+), 17 deletions(-)
Reviewed-by: Krzysztof Kozlowski krzysztof.kozlowski@canonical.com
Best regards, Krzysztof
On Wed, 28 Jul 2021 19:25:48 +0200, Rikard Falkeborn wrote:
These are only assigned to the ops field in the snd_soc_dai_link struct which is a pointer to const struct snd_soc_ops. 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: samsung: Constify static snd_soc_ops commit: 2080acf3d18029ca52189a14b2ee462ea89c5d06
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
participants (3)
-
Krzysztof Kozlowski
-
Mark Brown
-
Rikard Falkeborn