can: etas_es58x: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
PATCH 1/1 can: etas_es58x: 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 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.
--- drivers/net/can/usb/etas_es58x/es58x_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/usb/etas_es58x/es58x_core.h +1 -1
@@ -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); };/**
Signature · 1 line
2.34.1
Quoted 10 lines · Gustavo A. R. Silva
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_cmdwith the newDECLARE_FLEX_ARRAY()helper macro.This helper allows for a flexible-array member in a union.
Signature · 1 line
Kees Cook
Vincent MAILHOL
Acked-byQuoted 6 lines · Kees Cook
Quoted 5 lines · Gustavo A. R. Silva
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_cmdwith the newDECLARE_FLEX_ARRAY()helper macro.
Quoted 7 lines
Quoted 5 lines
This helper allows for a flexible-array member in a union.
Reviewed-by Kees Cook <[email protected]>
Yours sincerely,
Vincent Mailhol
Quoted 10 lines · Gustavo A. R. Silva
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_cmdwith the newDECLARE_FLEX_ARRAY()helper macro.This helper allows for a flexible-array member in a union.
Applied to linux-can-next.
Thanks,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |