Skip to content

Commit 492baeb

Browse files
GustavoARSilvawsakernel
authored andcommitted
i2c: acpi: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for flexible-array members in unions. Link: KSPP#193 Link: KSPP#218 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent 342530f commit 492baeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/i2c-core-acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct gsb_buffer {
2626
union {
2727
u16 wdata;
2828
u8 bdata;
29-
u8 data[0];
29+
DECLARE_FLEX_ARRAY(u8, data);
3030
};
3131
} __packed;
3232

0 commit comments

Comments
 (0)