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

ALSA: core: Constify snd_device_ops definitions

Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+9 -9
+1 -1
sound/core/compress_offload.c
··· 1099 1099 int snd_compress_new(struct snd_card *card, int device, 1100 1100 int dirn, const char *id, struct snd_compr *compr) 1101 1101 { 1102 - static struct snd_device_ops ops = { 1102 + static const struct snd_device_ops ops = { 1103 1103 .dev_free = snd_compress_dev_free, 1104 1104 .dev_register = snd_compress_dev_register, 1105 1105 .dev_disconnect = snd_compress_dev_disconnect,
+1 -1
sound/core/control.c
··· 1823 1823 */ 1824 1824 int snd_ctl_create(struct snd_card *card) 1825 1825 { 1826 - static struct snd_device_ops ops = { 1826 + static const struct snd_device_ops ops = { 1827 1827 .dev_free = snd_ctl_dev_free, 1828 1828 .dev_register = snd_ctl_dev_register, 1829 1829 .dev_disconnect = snd_ctl_dev_disconnect,
+1 -1
sound/core/hwdep.c
··· 353 353 { 354 354 struct snd_hwdep *hwdep; 355 355 int err; 356 - static struct snd_device_ops ops = { 356 + static const struct snd_device_ops ops = { 357 357 .dev_free = snd_hwdep_dev_free, 358 358 .dev_register = snd_hwdep_dev_register, 359 359 .dev_disconnect = snd_hwdep_dev_disconnect,
+1 -1
sound/core/jack.c
··· 201 201 struct snd_jack *jack; 202 202 struct snd_jack_kctl *jack_kctl = NULL; 203 203 int err; 204 - static struct snd_device_ops ops = { 204 + static const struct snd_device_ops ops = { 205 205 .dev_free = snd_jack_dev_free, 206 206 #ifdef CONFIG_SND_JACK_INPUT_DEV 207 207 .dev_register = snd_jack_dev_register,
+2 -2
sound/core/pcm.c
··· 706 706 { 707 707 struct snd_pcm *pcm; 708 708 int err; 709 - static struct snd_device_ops ops = { 709 + static const struct snd_device_ops ops = { 710 710 .dev_free = snd_pcm_dev_free, 711 711 .dev_register = snd_pcm_dev_register, 712 712 .dev_disconnect = snd_pcm_dev_disconnect, 713 713 }; 714 - static struct snd_device_ops internal_ops = { 714 + static const struct snd_device_ops internal_ops = { 715 715 .dev_free = snd_pcm_dev_free, 716 716 }; 717 717
+1 -1
sound/core/rawmidi.c
··· 1621 1621 { 1622 1622 struct snd_rawmidi *rmidi; 1623 1623 int err; 1624 - static struct snd_device_ops ops = { 1624 + static const struct snd_device_ops ops = { 1625 1625 .dev_free = snd_rawmidi_dev_free, 1626 1626 .dev_register = snd_rawmidi_dev_register, 1627 1627 .dev_disconnect = snd_rawmidi_dev_disconnect,
+1 -1
sound/core/seq_device.c
··· 193 193 { 194 194 struct snd_seq_device *dev; 195 195 int err; 196 - static struct snd_device_ops dops = { 196 + static const struct snd_device_ops dops = { 197 197 .dev_free = snd_seq_device_dev_free, 198 198 .dev_register = snd_seq_device_dev_register, 199 199 .dev_disconnect = snd_seq_device_dev_disconnect,
+1 -1
sound/core/timer.c
··· 936 936 { 937 937 struct snd_timer *timer; 938 938 int err; 939 - static struct snd_device_ops ops = { 939 + static const struct snd_device_ops ops = { 940 940 .dev_free = snd_timer_dev_free, 941 941 .dev_register = snd_timer_dev_register, 942 942 .dev_disconnect = snd_timer_dev_disconnect,