netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, linux-can@vger.kernel.org,
	kernel@pengutronix.de,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
	Kees Cook <keescook@chromium.org>,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH net-next 11/23] can: etas_es58x: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Date: Thu, 15 Sep 2022 10:20:01 +0200	[thread overview]
Message-ID: <20220915082013.369072-12-mkl@pengutronix.de> (raw)
In-Reply-To: <20220915082013.369072-1-mkl@pengutronix.de>

From: "Gustavo A. R. Silva" <gustavoars@kernel.org>

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
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/all/Yw00w6XRcq7B6ub6@work
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/usb/etas_es58x/es58x_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.h b/drivers/net/can/usb/etas_es58x/es58x_core.h
index d769bdf740b7..640fe0a1df63 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.h
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.h
@@ -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);
 };
 
 /**
-- 
2.35.1



  parent reply	other threads:[~2022-09-15  8:21 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15  8:19 [PATCH net-next 0/23] pull-request: can-next 2022-09-15 Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 01/23] can: rx-offload: can_rx_offload_init_queue(): fix typo Marc Kleine-Budde
2022-09-17 19:20   ` patchwork-bot+netdevbpf
2022-09-15  8:19 ` [PATCH net-next 02/23] can: flexcan: fix typo: FLEXCAN_QUIRK_SUPPPORT_* -> FLEXCAN_QUIRK_SUPPORT_* Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 03/23] can: rcar_canfd: Use dev_err_probe() to simplify code and better handle -EPROBE_DEFER Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 04/23] can: kvaser_usb: kvaser_usb_hydra: Use kzalloc for allocating only one element Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 05/23] dt-bindings: can: nxp,sja1000: Document RZ/N1 power-domains support Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 06/23] can: sja1000: Add support for RZ/N1 SJA1000 CAN Controller Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 07/23] can: sja1000: remove redundant variable ret Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 08/23] can: kvaser_pciefd: " Marc Kleine-Budde
2022-09-15  8:19 ` [PATCH net-next 09/23] can: gs_usb: use common spelling of GS_USB in macros Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 10/23] can: gs_usb: add RX and TX hardware timestamp support Marc Kleine-Budde
2022-09-15  8:20 ` Marc Kleine-Budde [this message]
2022-09-15  8:20 ` [PATCH net-next 12/23] dt-bindings: net: can: nxp,sja1000: drop ref from reg-io-width Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 13/23] docs: networking: device drivers: flexcan: fix invalid email Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 14/23] can: raw: process optimization in raw_init() Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 15/23] can: raw: use guard clause to optimize nesting in raw_rcv() Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 16/23] can: flexcan: Switch to use dev_err_probe() helper Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 17/23] can: skb: unify skb CAN frame identification helpers Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 18/23] can: skb: add skb CAN frame data length helpers Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 19/23] can: set CANFD_FDF flag in all CAN FD frame structures Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 20/23] can: canxl: introduce CAN XL data structure Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 21/23] can: canxl: update CAN infrastructure for CAN XL frames Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 22/23] can: dev: add CAN XL support to virtual CAN Marc Kleine-Budde
2022-09-15  8:20 ` [PATCH net-next 23/23] can: raw: add CAN XL support Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220915082013.369072-12-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).