s390/diag: replace zero-length array with flexible-array member
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 6 Apr 2023 14:28:42 +0000 (08:28 -0600)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 13 Apr 2023 15:36:28 +0000 (17:36 +0200)
Zero-length arrays are deprecated [1] and have to be replaced by C99
flexible-array members.

This helps with the ongoing efforts to tighten the FORTIFY_SOURCE routines
on memcpy() and help to make progress towards globally enabling
-fstrict-flex-arrays=3 [2]

Link: https://github.com/KSPP/linux/issues/78
Link: https://gcc.gnu.org/pipermail/gcc-patches/2022-October/602902.html
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZC7XGpUtVhqlRLhH@work
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/diag.h

index 674a939..902e033 100644 (file)
@@ -90,7 +90,7 @@ struct diag8c {
        u8 num_partitions;
        u16 width;
        u16 height;
-       u8 data[0];
+       u8 data[];
 } __packed __aligned(4);
 
 extern int diag8c(struct diag8c *out, struct ccw_dev_id *devno);