Commit d25ff268 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

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: default avatarTakashi Iwai <tiwai@suse.de>
parent 51055da5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3912,7 +3912,7 @@ For a raw-data proc-file, set the attributes as follows:

::

  static struct snd_info_entry_ops my_file_io_ops = {
  static const struct snd_info_entry_ops my_file_io_ops = {
          .read = my_file_io_read,
  };

+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ struct snd_info_entry {
	unsigned short content;
	union {
		struct snd_info_entry_text text;
		struct snd_info_entry_ops *ops;
		const struct snd_info_entry_ops *ops;
	} c;
	struct snd_info_entry *parent;
	struct module *module;
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ static ssize_t snd_opl4_mem_proc_write(struct snd_info_entry *entry,
	return count;
}

static struct snd_info_entry_ops snd_opl4_mem_proc_ops = {
static const struct snd_info_entry_ops snd_opl4_mem_proc_ops = {
	.open = snd_opl4_mem_proc_open,
	.release = snd_opl4_mem_proc_release,
	.read = snd_opl4_mem_proc_read,
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ static void snd_gf1_mem_proc_free(struct snd_info_entry *entry)
	kfree(priv);
}

static struct snd_info_entry_ops snd_gf1_mem_proc_ops = {
static const struct snd_info_entry_ops snd_gf1_mem_proc_ops = {
	.read = snd_gf1_mem_proc_dump,
};

+2 −2
Original line number Diff line number Diff line
@@ -1129,11 +1129,11 @@ static ssize_t snd_cs4281_BA1_read(struct snd_info_entry *entry,
	return count;
}

static struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = {
static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA0 = {
	.read = snd_cs4281_BA0_read,
};

static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = {
static const struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = {
	.read = snd_cs4281_BA1_read,
};

Loading