Skip to content

Commit

Permalink
can: etas_es58x: Replace zero-length array with DECLARE_FLEX_ARRAY() …
Browse files Browse the repository at this point in the history
…helper

Zero-length arrays are deprecated and we are moving towards adopting
C99 flexible-array members, instead. So, replace zero-length array
declaration in union es58x_urb_cmd with the new DECLARE_FLEX_ARRAY()
helper macro.

This helper allows for a flexible-array member in a union.

Link: https://github.com/KSPP/linux/issues/193
Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
  • Loading branch information
Gustavo A. R. Silva committed Sep 3, 2022
1 parent 1c23f9e commit 7626d50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/usb/etas_es58x/es58x_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ union es58x_urb_cmd {
u8 cmd_type;
u8 cmd_id;
} __packed;
u8 raw_cmd[0];
DECLARE_FLEX_ARRAY(u8, raw_cmd);
};

/**
Expand Down

0 comments on commit 7626d50

Please sign in to comment.