Skip to content

Commit d25ff26

Browse files
committed
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>
1 parent 51055da commit d25ff26

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎Documentation/sound/kernel-api/writing-an-alsa-driver.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3912,7 +3912,7 @@ For a raw-data proc-file, set the attributes as follows:
39123912

39133913
::
39143914

3915-
static struct snd_info_entry_ops my_file_io_ops = {
3915+
static const struct snd_info_entry_ops my_file_io_ops = {
39163916
.read = my_file_io_read,
39173917
};
39183918

‎include/sound/info.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct snd_info_entry {
6464
unsigned short content;
6565
union {
6666
struct snd_info_entry_text text;
67-
struct snd_info_entry_ops *ops;
67+
const struct snd_info_entry_ops *ops;
6868
} c;
6969
struct snd_info_entry *parent;
7070
struct module *module;

‎sound/drivers/opl4/opl4_proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static ssize_t snd_opl4_mem_proc_write(struct snd_info_entry *entry,
7676
return count;
7777
}
7878

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 = {
8080
.open = snd_opl4_mem_proc_open,
8181
.release = snd_opl4_mem_proc_release,
8282
.read = snd_opl4_mem_proc_read,

‎sound/isa/gus/gus_mem_proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static void snd_gf1_mem_proc_free(struct snd_info_entry *entry)
3737
kfree(priv);
3838
}
3939

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 = {
4141
.read = snd_gf1_mem_proc_dump,
4242
};
4343

‎sound/pci/cs4281.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,11 +1129,11 @@ static ssize_t snd_cs4281_BA1_read(struct snd_info_entry *entry,
11291129
return count;
11301130
}
11311131

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 = {
11331133
.read = snd_cs4281_BA0_read,
11341134
};
11351135

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 = {
11371137
.read = snd_cs4281_BA1_read,
11381138
};
11391139

‎sound/pci/cs46xx/cs46xx_lib.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2815,7 +2815,7 @@ static ssize_t snd_cs46xx_io_read(struct snd_info_entry *entry,
28152815
return count;
28162816
}
28172817

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 = {
28192819
.read = snd_cs46xx_io_read,
28202820
};
28212821

‎sound/pci/emu10k1/emuproc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ static void snd_emu_proc_ptr_reg_read20c(struct snd_info_entry *entry,
545545
}
546546
#endif
547547

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 = {
549549
.read = snd_emu10k1_fx8010_read,
550550
};
551551

‎sound/pci/mixart/mixart.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,11 +1153,11 @@ static ssize_t snd_mixart_BA1_read(struct snd_info_entry *entry,
11531153
return count;
11541154
}
11551155

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 = {
11571157
.read = snd_mixart_BA0_read,
11581158
};
11591159

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 = {
11611161
.read = snd_mixart_BA1_read,
11621162
};
11631163

0 commit comments

Comments
 (0)