]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: rawmidi: Add const to snd_rawmidi_ops
authorTakashi Iwai <tiwai@suse.de>
Thu, 5 Jan 2017 16:01:14 +0000 (17:01 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 12 Jan 2017 11:49:36 +0000 (12:49 +0100)
Make snd_rawmidi_substream.ops to be a const pointer to be safer and
allow more optimization.  The patches to constify each rawmidi ops
will follow.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/rawmidi.h
sound/core/rawmidi.c

index f730b91e472f19f97b15ec8982443fe099dd5db4..492a3ca7f17bd0ba210ac57f6d7109d31ee841cd 100644 (file)
@@ -103,7 +103,7 @@ struct snd_rawmidi_substream {
        struct snd_rawmidi_runtime *runtime;
        struct pid *pid;
        /* hardware layer */
-       struct snd_rawmidi_ops *ops;
+       const struct snd_rawmidi_ops *ops;
 };
 
 struct snd_rawmidi_file {
@@ -155,7 +155,7 @@ int snd_rawmidi_new(struct snd_card *card, char *id, int device,
                    int output_count, int input_count,
                    struct snd_rawmidi **rmidi);
 void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
-                        struct snd_rawmidi_ops *ops);
+                        const struct snd_rawmidi_ops *ops);
 
 /* callbacks */
 
index 2096bb0835c8a85e557fa40f0c15212018ada5c6..8da9cb245d01509d3c84429743d43ffa15e321d9 100644 (file)
@@ -1749,7 +1749,7 @@ static int snd_rawmidi_dev_disconnect(struct snd_device *device)
  * Sets the rawmidi operators for the given stream direction.
  */
 void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
-                        struct snd_rawmidi_ops *ops)
+                        const struct snd_rawmidi_ops *ops)
 {
        struct snd_rawmidi_substream *substream;