提交 f2459201 编写于 作者: H Himangi Saraogi 提交者: Greg Kroah-Hartman

staging:line6: Fix use of variable length arrays

This patch fixes the sparse warning:
drivers/staging/line6/midi.c:50:34: warning: Variable length array is used.
The size is same as the variable LINE6_FALLBACK_MAXPACKETSIZE,
so use that.
Signed-off-by: NHimangi Saraogi <himangi774@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6afaab95
...@@ -47,7 +47,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream) ...@@ -47,7 +47,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
struct snd_line6_midi *line6midi = line6->line6midi; struct snd_line6_midi *line6midi = line6->line6midi;
struct midi_buffer *mb = &line6midi->midibuf_out; struct midi_buffer *mb = &line6midi->midibuf_out;
unsigned long flags; unsigned long flags;
unsigned char chunk[line6->max_packet_size]; unsigned char chunk[LINE6_FALLBACK_MAXPACKETSIZE];
int req, done; int req, done;
spin_lock_irqsave(&line6->line6midi->midi_transmit_lock, flags); spin_lock_irqsave(&line6->line6midi->midi_transmit_lock, flags);
...@@ -64,7 +64,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream) ...@@ -64,7 +64,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
} }
for (;;) { for (;;) {
done = line6_midibuf_read(mb, chunk, line6->max_packet_size); done = line6_midibuf_read(mb, chunk, LINE6_FALLBACK_MAXPACKETSIZE);
if (done == 0) if (done == 0)
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册