Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: topology: Constify struct snd_soc_tplg_ops

Constifying "struct snd_soc_tplg_ops" moves some data to a read-only
section, so increase overall security.

On a x86_64, with allmodconfig:
Before:
text data bss dec hex filename
44519 2888 48 47455 b95f sound/soc/sof/topology.o

After:
text data bss dec hex filename
44839 2552 48 47439 b94f sound/soc/sof/topology.o

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://msgid.link/r/2d9f5b75e979eb38b6f3baf85dfa1f0fdb3447ef.1715526069.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Christophe JAILLET and committed by
Mark Brown
e9c33917 9ff6aaf0

+2 -2
+2 -2
sound/soc/sof/topology.c
··· 2278 2278 {SOF_TPLG_KCTL_BYTES_VOLATILE_RO, snd_sof_bytes_ext_volatile_get}, 2279 2279 }; 2280 2280 2281 - static struct snd_soc_tplg_ops sof_tplg_ops = { 2281 + static const struct snd_soc_tplg_ops sof_tplg_ops = { 2282 2282 /* external kcontrol init - used for any driver specific init */ 2283 2283 .control_load = sof_control_load, 2284 2284 .control_unload = sof_control_unload, ··· 2433 2433 return 0; 2434 2434 } 2435 2435 2436 - static struct snd_soc_tplg_ops sof_dspless_tplg_ops = { 2436 + static const struct snd_soc_tplg_ops sof_dspless_tplg_ops = { 2437 2437 /* external widget init - used for any driver specific init */ 2438 2438 .widget_ready = sof_dspless_widget_ready, 2439 2439 .widget_unload = sof_dspless_widget_unload,