staging:line6: Fix use of variable length arrays
authorHimangi Saraogi <himangi774@gmail.com>
Sun, 9 Mar 2014 00:17:12 +0000 (05:47 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Mar 2014 04:35:16 +0000 (20:35 -0800)
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: Himangi Saraogi <himangi774@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/line6/midi.c

index 3f6d78c585fb925d75bb630e07dab6f67c124b95..a95c8578521377332f95da1caf8b2a64d06712e4 100644 (file)
@@ -47,7 +47,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
        struct snd_line6_midi *line6midi = line6->line6midi;
        struct midi_buffer *mb = &line6midi->midibuf_out;
        unsigned long flags;
-       unsigned char chunk[line6->max_packet_size];
+       unsigned char chunk[LINE6_FALLBACK_MAXPACKETSIZE];
        int req, done;
 
        spin_lock_irqsave(&line6->line6midi->midi_transmit_lock, flags);
@@ -64,7 +64,7 @@ static void line6_midi_transmit(struct snd_rawmidi_substream *substream)
        }
 
        for (;;) {
-               done = line6_midibuf_read(mb, chunk, line6->max_packet_size);
+               done = line6_midibuf_read(mb, chunk, LINE6_FALLBACK_MAXPACKETSIZE);
 
                if (done == 0)
                        break;