Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1711957 > unrolled thread

[PATCH 1/3] usb: gadget: f_midi: constify snd_rawmidi_ops structures

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2017-08-15 10:40 +0200
Last post2017-08-15 10:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] usb: gadget: f_midi: constify snd_rawmidi_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2017-08-15 10:40 +0200

#1711957 — [PATCH 1/3] usb: gadget: f_midi: constify snd_rawmidi_ops structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2017-08-15 10:40 +0200
Subject[PATCH 1/3] usb: gadget: f_midi: constify snd_rawmidi_ops structures
Message-ID<ueFyi-7nU-13@gated-at.bofh.it>
These snd_rawmidi_ops structures are only passed as the third
argument of snd_rawmidi_set_ops.  This argument is const, so the
snd_rawmidi_ops structures can be const too.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/usb/gadget/function/f_midi.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/f_midi.c b/drivers/usb/gadget/function/f_midi.c
index a5719f2..71ca86c0 100644
--- a/drivers/usb/gadget/function/f_midi.c
+++ b/drivers/usb/gadget/function/f_midi.c
@@ -755,13 +755,13 @@ static void f_midi_out_trigger(struct snd_rawmidi_substream *substream, int up)
 		clear_bit(substream->number, &midi->out_triggered);
 }
 
-static struct snd_rawmidi_ops gmidi_in_ops = {
+static const struct snd_rawmidi_ops gmidi_in_ops = {
 	.open = f_midi_in_open,
 	.close = f_midi_in_close,
 	.trigger = f_midi_in_trigger,
 };
 
-static struct snd_rawmidi_ops gmidi_out_ops = {
+static const struct snd_rawmidi_ops gmidi_out_ops = {
 	.open = f_midi_out_open,
 	.close = f_midi_out_close,
 	.trigger = f_midi_out_trigger

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web