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

ALSA: info: Make snd_info_entry_ops as const

The reference to snd_info_entry_ops is rather read-only, so declare it
as a const pointer. This allows a bit more optimization.

There should be no functional changes by this patch.

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

+10 -10
+1 -1
Documentation/sound/kernel-api/writing-an-alsa-driver.rst
··· 3912 3912 3913 3913 :: 3914 3914 3915 - static struct snd_info_entry_ops my_file_io_ops = { 3915 + static const struct snd_info_entry_ops my_file_io_ops = { 3916 3916 .read = my_file_io_read, 3917 3917 }; 3918 3918
+1 -1
include/sound/info.h
··· 64 64 unsigned short content; 65 65 union { 66 66 struct snd_info_entry_text text; 67 - struct snd_info_entry_ops *ops; 67 + const struct snd_info_entry_ops *ops; 68 68 } c; 69 69 struct snd_info_entry *parent; 70 70 struct module *module;
+1 -1
sound/drivers/opl4/opl4_proc.c
··· 76 76 return count; 77 77 } 78 78 79 - static struct snd_info_entry_ops snd_opl4_mem_proc_ops = { 79 + static const struct snd_info_entry_ops snd_opl4_mem_proc_ops = { 80 80 .open = snd_opl4_mem_proc_open, 81 81 .release = snd_opl4_mem_proc_release, 82 82 .read = snd_opl4_mem_proc_read,
+1 -1
sound/isa/gus/gus_mem_proc.c
··· 37 37 kfree(priv); 38 38 } 39 39 40 - static struct snd_info_entry_ops snd_gf1_mem_proc_ops = { 40 + static const struct snd_info_entry_ops snd_gf1_mem_proc_ops = { 41 41 .read = snd_gf1_mem_proc_dump, 42 42 }; 43 43
+2 -2
sound/pci/cs4281.c
··· 1129 1129 return count; 1130 1130 } 1131 1131 1132 - static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { 1132 + static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = { 1133 1133 .read = snd_cs4281_BA0_read, 1134 1134 }; 1135 1135 1136 - static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { 1136 + static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = { 1137 1137 .read = snd_cs4281_BA1_read, 1138 1138 }; 1139 1139
+1 -1
sound/pci/cs46xx/cs46xx_lib.c
··· 2815 2815 return count; 2816 2816 } 2817 2817 2818 - static struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { 2818 + static const struct snd_info_entry_ops snd_cs46xx_proc_io_ops = { 2819 2819 .read = snd_cs46xx_io_read, 2820 2820 }; 2821 2821
+1 -1
sound/pci/emu10k1/emuproc.c
··· 545 545 } 546 546 #endif 547 547 548 - static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = { 548 + static const struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = { 549 549 .read = snd_emu10k1_fx8010_read, 550 550 }; 551 551
+2 -2
sound/pci/mixart/mixart.c
··· 1153 1153 return count; 1154 1154 } 1155 1155 1156 - static struct snd_info_entry_ops snd_mixart_proc_ops_BA0 = { 1156 + static const struct snd_info_entry_ops snd_mixart_proc_ops_BA0 = { 1157 1157 .read = snd_mixart_BA0_read, 1158 1158 }; 1159 1159 1160 - static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = { 1160 + static const struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = { 1161 1161 .read = snd_mixart_BA1_read, 1162 1162 }; 1163 1163