fbdev: amifb: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper
authorAtul Raut <rauji.raut@gmail.com>
Mon, 31 Jul 2023 02:18:08 +0000 (19:18 -0700)
committerHelge Deller <deller@gmx.de>
Mon, 31 Jul 2023 12:54:08 +0000 (14:54 +0200)
Replacing zero-length arrays with C99 flexible-array members
because they are deprecated. Use the new DECLARE_FLEX_ARRAY()
auxiliary macro instead of defining a zero-length array.

This fixes warnings such as:
./drivers/video/fbdev/amifb.c:690:6-10: WARNING use flexible-array member instead

Signed-off-by: Atul Raut <rauji.raut@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/amifb.c

index d88265d..f216b2c 100644 (file)
@@ -687,7 +687,7 @@ struct fb_var_cursorinfo {
        __u16 height;
        __u16 xspot;
        __u16 yspot;
-       __u8 data[1];                   /* field with [height][width]        */
+       DECLARE_FLEX_ARRAY(__u8, data); /* field with [height][width]        */
 };
 
 struct fb_cursorstate {