can: ucan: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Subsystems (3)
PATCH 1/1 can: ucan: 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.
--- drivers/net/can/usb/ucan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/can/usb/ucan.c +2 -1
@@ -245,7 +245,8 @@ struct ucan_message_in {/* CAN transmission complete * (type == UCAN_IN_TX_COMPLETE) */ -struct ucan_tx_complete_entry_t can_tx_complete_msg[0 ]; + DECLARE_FLEX_ARRAY(struct ucan_tx_complete_entry_t, + can_tx_complete_msg); }__aligned(0x4) msg; } __packed__aligned(0x4) ;
Signature · 1 line
2.34.1
Quoted 11 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 arrays declarations in anonymous union with the new
DECLARE_FLEX_ARRAY()helper macro.This helper allows for flexible-array members in unions.
Signature · 1 line
Kees Cook
Quoted 11 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 arrays declarations in anonymous union with the new
DECLARE_FLEX_ARRAY()helper macro.This helper allows for flexible-array members in unions.
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 |