diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-05-13 19:57:16 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2024-05-27 01:31:24 +0100 |
commit | ed2581305360725381190bc442918e4e5b2b8545 (patch) | |
tree | 555f28d6f9a1cf817f0031145e78374d325db57b /sound/soc/intel/boards/kbl_da7219_max98357a.c | |
parent | 5dfd8f78b57641530bb674791b66b4ae8a8417f5 (diff) | |
download | linux-ed2581305360725381190bc442918e4e5b2b8545.tar.gz linux-ed2581305360725381190bc442918e4e5b2b8545.tar.bz2 linux-ed2581305360725381190bc442918e4e5b2b8545.zip |
ASoC: intel: Constify struct snd_soc_ops
Constifying "struct snd_soc_ops" moves some data to a read-only section, so
increase overall security.
This structure is also part of scripts/const_structs.checkpatch.
As an example, on a x86_64, with allmodconfig:
Before:
text data bss dec hex filename
6315 3696 0 10011 271b sound/soc/intel/boards/ehl_rt5660.o
After:
text data bss dec hex filename
6379 3648 0 10027 272b sound/soc/intel/boards/ehl_rt5660.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/2f0613bf4c6018569cdaac876d0589e49cf38a80.1715622793.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards/kbl_da7219_max98357a.c')
-rw-r--r-- | sound/soc/intel/boards/kbl_da7219_max98357a.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index 9dbc15f9d1c9..154f6a74ed15 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -354,7 +354,7 @@ static int kabylake_dmic_startup(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_RATE, &constraints_rates); } -static struct snd_soc_ops kabylake_dmic_ops = { +static const struct snd_soc_ops kabylake_dmic_ops = { .startup = kabylake_dmic_startup, }; @@ -388,7 +388,7 @@ static int kabylake_refcap_startup(struct snd_pcm_substream *substream) &constraints_16000); } -static struct snd_soc_ops skylake_refcap_ops = { +static const struct snd_soc_ops skylake_refcap_ops = { .startup = kabylake_refcap_startup, }; |