ALSA: midi: constify snd_rawmidi_global_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 22 Nov 2015 07:55:07 +0000 (08:55 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 22 Nov 2015 08:21:16 +0000 (09:21 +0100)
The snd_rawmidi_global_ops structures are never modified, so declare them
as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/rawmidi.h
sound/core/seq/seq_virmidi.c
sound/usb/midi.c

index f6cbef78db620f2ff85c02126f9a9518553cf2c1..fdabbb4ddba92f801e2952fafaeb997c7fa03a33 100644 (file)
@@ -130,7 +130,7 @@ struct snd_rawmidi {
        int ossreg;
 #endif
 
-       struct snd_rawmidi_global_ops *ops;
+       const struct snd_rawmidi_global_ops *ops;
 
        struct snd_rawmidi_str streams[2];
 
index 56e0f4cd3f8299837053961747a64b8a736b3867..3da2d48610b3a91e4b93b0967b1fac5afebe41f7 100644 (file)
@@ -468,7 +468,7 @@ static int snd_virmidi_dev_unregister(struct snd_rawmidi *rmidi)
 /*
  *
  */
-static struct snd_rawmidi_global_ops snd_virmidi_global_ops = {
+static const struct snd_rawmidi_global_ops snd_virmidi_global_ops = {
        .dev_register = snd_virmidi_dev_register,
        .dev_unregister = snd_virmidi_dev_unregister,
 };
index 5b4c58c3e2c5f6115d55ad194cd06f971e3fdb70..ee212e71f180e4f7971fc0ae50c7ff054fb16bb6 100644 (file)
@@ -2206,7 +2206,7 @@ static int snd_usbmidi_create_endpoints_midiman(struct snd_usb_midi *umidi,
        return 0;
 }
 
-static struct snd_rawmidi_global_ops snd_usbmidi_ops = {
+static const struct snd_rawmidi_global_ops snd_usbmidi_ops = {
        .get_port_info = snd_usbmidi_get_port_info,
 };