ALSA: line6: make snd_pcm_ops const
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 27 Sep 2017 06:19:27 +0000 (11:49 +0530)
committerTakashi Iwai <tiwai@suse.de>
Mon, 2 Oct 2017 12:33:23 +0000 (14:33 +0200)
Make these const as they are only passed to a const argument of the
function snd_pcm_set_ops in the file referencing them. Also, add const
to the declaration in the headers.

Structures found using Coccinelle and changes done by hand.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/line6/capture.c
sound/usb/line6/capture.h
sound/usb/line6/playback.c
sound/usb/line6/playback.h

index 7c812565f90db03f5c11fbcf3f92854b0eb3e772..947d6168f24abe477e7ec9456e7c4fe293138707 100644 (file)
@@ -248,7 +248,7 @@ static int snd_line6_capture_close(struct snd_pcm_substream *substream)
 }
 
 /* capture operators */
-struct snd_pcm_ops snd_line6_capture_ops = {
+const struct snd_pcm_ops snd_line6_capture_ops = {
        .open = snd_line6_capture_open,
        .close = snd_line6_capture_close,
        .ioctl = snd_pcm_lib_ioctl,
index 890b21bff18c7daa43d27be73bf92858530135f8..b67ccc39fd25ad9537003687c332f86d1741924c 100644 (file)
@@ -17,7 +17,7 @@
 #include "driver.h"
 #include "pcm.h"
 
-extern struct snd_pcm_ops snd_line6_capture_ops;
+extern const struct snd_pcm_ops snd_line6_capture_ops;
 
 extern void line6_capture_copy(struct snd_line6_pcm *line6pcm, char *fbuf,
                               int fsize);
index 812d18191e018abc588c5a18306d413181e3af04..819e9b2d1d6e5ea4376c2d85829311937ef9958a 100644 (file)
@@ -393,7 +393,7 @@ static int snd_line6_playback_close(struct snd_pcm_substream *substream)
 }
 
 /* playback operators */
-struct snd_pcm_ops snd_line6_playback_ops = {
+const struct snd_pcm_ops snd_line6_playback_ops = {
        .open = snd_line6_playback_open,
        .close = snd_line6_playback_close,
        .ioctl = snd_pcm_lib_ioctl,
index 51fce29e87269b3412201e3f63cb63a1661c3dca..d8d3b8a07a72f43d092b7d523edbab3a60e01419 100644 (file)
@@ -27,7 +27,7 @@
  */
 #define USE_CLEAR_BUFFER_WORKAROUND 1
 
-extern struct snd_pcm_ops snd_line6_playback_ops;
+extern const struct snd_pcm_ops snd_line6_playback_ops;
 
 extern int line6_create_audio_out_urbs(struct snd_line6_pcm *line6pcm);
 extern int line6_submit_audio_out_all_urbs(struct snd_line6_pcm *line6pcm);