Skip to contentSkip to conversation

ASLA: emu10k1: constify snd_emux_operators structure

PATCH In review Bhumika Goyal 3 participants 3 messages Feb 19, 2017 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASLA: emu10k1: constify snd_emux_operators structure

Declare snd_emux_operators structure as const as it is only copied into another structure. So, snd_emux_operators structures having this property can be made const.

---
 sound/pci/emu10k1/emu10k1_callback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/emu10k1/emu10k1_callback.c +1 -1
index d2c7ea3..aa2cc27 100644
@@ -61,7 +61,7 @@ static struct snd_emux_voice *get_voice(struct snd_emux *emux,
 /*
  * set up operators
  */
-static struct snd_emux_operators emu10k1_ops = {
+static const struct snd_emux_operators emu10k1_ops = {
 	.owner =	THIS_MODULE,
 	.get_voice =	get_voice,
 	.prepare =	start_voice,
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Bhumika Goyal

Declare snd_emux_operators structure as const as it is only copied into another structure. So, snd_emux_operators structures having this property can be made const.

Applied now (with a typo fix in the subject :)

thanks,

Takashi

Reviewed-by on v1 1/1
#2 lore raw
In reply to Bhumika Goyal
Quoted 5 lines · Bhumika Goyal

Declare snd_emux_operators structure as const as it is only copied into another structure. So, snd_emux_operators structures having this property can be made const.

...The 'ASLA' reminds me of the god in Indian myth[0]. When Buddhism disseminated to Japan via China, the god changed its name and became the god in Japanese Buddhism, too.

...I'm just a kidding. The title should be fixed with 'ALSA' ;)

Quoted 9 lines
---
 sound/pci/emu10k1/emu10k1_callback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/emu10k1/emu10k1_callback.c +0 -0
index d2c7ea3..aa2cc27 100644

sound/pci/emu10k1/emu10k1_callback.c static struct snd_emux_voice *get_voice(struct snd_emux *emux, · line 67

Quoted 8 lines
sound/pci/emu10k1/emu10k1_callback.c +1 -1
@@ -61,7 +61,7 @@ static struct snd_emux_voice *get_voice(struct snd_emux *emux,
 /*
  * set up operators
  */
-static struct snd_emux_operators emu10k1_ops = {
+static const struct snd_emux_operators emu10k1_ops = {
 	.owner =	THIS_MODULE,
 	.get_voice =	get_voice,
 	.prepare =	start_voice,

[0] https://en.wikipedia.org/wiki/Asura
[1] https://en.wikipedia.org/wiki/Asura_(Buddhism)

Regards

Takashi Sakamoto