]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
m68k/atari: Avoid VLA use in atari_switches_setup()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 6 Jan 2019 20:09:58 +0000 (21:09 +0100)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Mon, 21 Jan 2019 09:36:53 +0000 (10:36 +0100)
With gcc 7.3.0:

    arch/m68k/atari/config.c: In function ‘atari_switches_setup’:
    arch/m68k/atari/config.c:151:2: warning: ISO C90 forbids variable length array ‘switches’ [-Wvla]
      char switches[strlen(str) + 1];
      ^~~~

Replace the variable size by the maximum kernel command line size (256
bytes), which is an upper limit for all suboptions.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/atari/config.c

index bd96702a1ad0977334a31ea21d8c782c7ddf1f00..4fcc4b1df1c0f2b4d417a9ce96d29dc740755126 100644 (file)
@@ -148,7 +148,7 @@ int __init atari_parse_bootinfo(const struct bi_record *record)
 /* Parse the Atari-specific switches= option. */
 static int __init atari_switches_setup(char *str)
 {
-       char switches[strlen(str) + 1];
+       char switches[COMMAND_LINE_SIZE];
        char *p;
        int ovsc_shift;
        char *args = switches;