Skip to content

Commit

Permalink
ALSA: midi: constify snd_rawmidi_global_ops structures
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
JuliaLawall authored and tiwai committed Nov 22, 2015
1 parent 7a7a2df commit efdbe3c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/sound/rawmidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion sound/core/seq/seq_virmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
2 changes: 1 addition & 1 deletion sound/usb/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down

0 comments on commit efdbe3c

Please sign in to comment.