]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
video: fbdev: via: remove VLA usage
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 12 Mar 2018 16:06:55 +0000 (17:06 +0100)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Mon, 12 Mar 2018 16:06:55 +0000 (17:06 +0100)
In preparation to enabling -Wvla, remove VLA usage.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/via/via_aux_sii164.c
drivers/video/fbdev/via/via_aux_vt1631.c
drivers/video/fbdev/via/via_aux_vt1632.c
drivers/video/fbdev/via/via_aux_vt1636.c

index ca1b35f033b10c8be52ce244245e27918a763378..c27f62c2c75acc9360a203779583fc50a1dc352f 100644 (file)
@@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr)
                .name   =       name};
        /* check vendor id and device id */
        const u8 id[] = {0x01, 0x00, 0x06, 0x00}, len = ARRAY_SIZE(id);
-       u8 tmp[len];
+       u8 tmp[ARRAY_SIZE(id)];
 
        if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
                return;
index 06e742f1f72362cab7373656f098592f222a560b..32978a0ccfd72fb1d64c67d72578e902c6e6bd10 100644 (file)
@@ -36,7 +36,7 @@ void via_aux_vt1631_probe(struct via_aux_bus *bus)
                .name   =       name};
        /* check vendor id and device id */
        const u8 id[] = {0x06, 0x11, 0x91, 0x31}, len = ARRAY_SIZE(id);
-       u8 tmp[len];
+       u8 tmp[ARRAY_SIZE(id)];
 
        if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
                return;
index d24f4cd97401703c667c8c0704e8ff959cd89dc3..cec8cc43d524099e72d3ad737656c30f0b0cbf81 100644 (file)
@@ -36,7 +36,7 @@ static void probe(struct via_aux_bus *bus, u8 addr)
                .name   =       name};
        /* check vendor id and device id */
        const u8 id[] = {0x06, 0x11, 0x92, 0x31}, len = ARRAY_SIZE(id);
-       u8 tmp[len];
+       u8 tmp[ARRAY_SIZE(id)];
 
        if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
                return;
index 9e015c101d4db7c6e3af198e6c00327a9a780515..2b10bc21ab79e80d525e11513c7f09aa268b2b8f 100644 (file)
@@ -36,7 +36,7 @@ void via_aux_vt1636_probe(struct via_aux_bus *bus)
                .name   =       name};
        /* check vendor id and device id */
        const u8 id[] = {0x06, 0x11, 0x45, 0x33}, len = ARRAY_SIZE(id);
-       u8 tmp[len];
+       u8 tmp[ARRAY_SIZE(id)];
 
        if (!via_aux_read(&drv, 0x00, tmp, len) || memcmp(id, tmp, len))
                return;