Skip to content

Commit 005c960

Browse files
atulrautkuba-moo
authored andcommitted
net/macmace: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Since zero-length arrays are deprecated, we are replacing them with C99 flexible-array members. As a result, instead of declaring a zero-length array, use the new DECLARE_FLEX_ARRAY() helper macro. This fixes warnings such as: ./drivers/net/ethernet/apple/macmace.c:80:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Atul Raut <rauji.raut@gmail.com> Link: https://lore.kernel.org/r/20230730231442.15003-1-rauji.raut@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 01e6f8a commit 005c960

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/apple/macmace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct mace_frame {
7777
u8 pad4;
7878
u32 pad5;
7979
u32 pad6;
80-
u8 data[1];
80+
DECLARE_FLEX_ARRAY(u8, data);
8181
/* And frame continues.. */
8282
};
8383

0 commit comments

Comments
 (0)