2021-11-27 09:23:03

by Rikard Falkeborn

[permalink] [raw]
Subject: [PATCH] ASoC: intel: boards: bytcht*: Constify static snd_soc_ops

These are only assigned to the ops fields 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 <[email protected]>
---
sound/soc/intel/boards/bytcht_cx2072x.c | 2 +-
sound/soc/intel/boards/bytcht_nocodec.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/bytcht_cx2072x.c b/sound/soc/intel/boards/bytcht_cx2072x.c
index 0a736308052a..ffd497a5b5a5 100644
--- a/sound/soc/intel/boards/bytcht_cx2072x.c
+++ b/sound/soc/intel/boards/bytcht_cx2072x.c
@@ -147,7 +147,7 @@ static int byt_cht_cx2072x_aif1_startup(struct snd_pcm_substream *substream)
SNDRV_PCM_HW_PARAM_RATE, 48000);
}

-static struct snd_soc_ops byt_cht_cx2072x_aif1_ops = {
+static const struct snd_soc_ops byt_cht_cx2072x_aif1_ops = {
.startup = byt_cht_cx2072x_aif1_startup,
};

diff --git a/sound/soc/intel/boards/bytcht_nocodec.c b/sound/soc/intel/boards/bytcht_nocodec.c
index 67b3c4e97864..115c2bcaabd4 100644
--- a/sound/soc/intel/boards/bytcht_nocodec.c
+++ b/sound/soc/intel/boards/bytcht_nocodec.c
@@ -93,7 +93,7 @@ static int aif1_startup(struct snd_pcm_substream *substream)
&constraints_48000);
}

-static struct snd_soc_ops aif1_ops = {
+static const struct snd_soc_ops aif1_ops = {
.startup = aif1_startup,
};

--
2.34.1



2021-11-29 16:36:23

by Pierre-Louis Bossart

[permalink] [raw]
Subject: Re: [PATCH] ASoC: intel: boards: bytcht*: Constify static snd_soc_ops



On 11/27/21 3:19 AM, Rikard Falkeborn wrote:
> These are only assigned to the ops fields 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 <[email protected]>

Acked-by: Pierre-Louis Bossart <[email protected]>

2021-12-01 18:32:24

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] ASoC: intel: boards: bytcht*: Constify static snd_soc_ops

On Sat, 27 Nov 2021 10:19:54 +0100, Rikard Falkeborn wrote:
> These are only assigned to the ops fields 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: intel: boards: bytcht*: Constify static snd_soc_ops
commit: 10b155fd413d31c89057986d0fc3d4ceef8e0e9f

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