ALSA: drivers: Constify snd_device_ops definitions
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:16:21 +0000 (09:16 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:23:52 +0000 (09:23 +0100)
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-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/drivers/ml403-ac97cr.c
sound/drivers/opl3/opl3_lib.c
sound/drivers/opl4/opl4_lib.c
sound/drivers/pcsp/pcsp.c
sound/drivers/serial-u16550.c

index d1e01d8..2cec7c5 100644 (file)
@@ -1076,7 +1076,7 @@ snd_ml403_ac97cr_create(struct snd_card *card, struct platform_device *pfdev,
 {
        struct snd_ml403_ac97cr *ml403_ac97cr;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_ml403_ac97cr_dev_free,
        };
        struct resource *resource;
index cbdec28..6134e5f 100644 (file)
@@ -332,7 +332,7 @@ int snd_opl3_new(struct snd_card *card,
                 unsigned short hardware,
                 struct snd_opl3 **ropl3)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_opl3_dev_free,
        };
        struct snd_opl3 *opl3;
index 901d339..035645e 100644 (file)
@@ -184,7 +184,7 @@ int snd_opl4_create(struct snd_card *card,
        struct snd_opl4 *opl4;
        struct snd_opl3 *opl3;
        int err;
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free = snd_opl4_dev_free
        };
 
index 14aacd8..fd79e57 100644 (file)
@@ -43,7 +43,7 @@ struct snd_pcsp pcsp_chip;
 
 static int snd_pcsp_create(struct snd_card *card)
 {
-       static struct snd_device_ops ops = { };
+       static const struct snd_device_ops ops = { };
        unsigned int resolution = hrtimer_resolution;
        int err, div, min_div, order;
 
index 4775f1b..893c2b5 100644 (file)
@@ -777,7 +777,7 @@ static int snd_uart16550_create(struct snd_card *card,
                                int droponfull,
                                struct snd_uart16550 **ruart)
 {
-       static struct snd_device_ops ops = {
+       static const struct snd_device_ops ops = {
                .dev_free =     snd_uart16550_dev_free,
        };
        struct snd_uart16550 *uart;