Re: [PATCH] staging: greybus: Replace zero-length array by DECLARE_FLEX_ARRAY() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 1/3/23 9:57 PM, Deepak R Varma wrote:
The code currently uses C90 standard extension based zero length array
struct which is now deprecated and the new C99 standard extension of
flexible array declarations are to be used instead. Also, the macro
DECLARE_FLEX_ARRAY() allows to use single flexible array member in a
structure. Refer to these links [1], [2] for details.

Thank you for citing some references in your commit, it's
a good and helpful practice.  This might have been another
helpful one:


FYI, Linux mailing lists hosted by are normally
cited using "" now, e.g.:
Your patch is fine, this is just so you can consider this
in the future.

Issue identified using Coccinelle flexible_array.cocci semantic patch.

Signed-off-by: Deepak R Varma <drv@xxxxxxxxx>

Looks good to me.

Reviewed-by: Alex Elder <elder@xxxxxxxxxx>

  drivers/staging/greybus/usb.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/usb.c b/drivers/staging/greybus/usb.c
index 8e9d9d59a357..b7badf87a3f0 100644
--- a/drivers/staging/greybus/usb.c
+++ b/drivers/staging/greybus/usb.c
@@ -27,7 +27,7 @@ struct gb_usb_hub_control_request {

  struct gb_usb_hub_control_response {
-	u8 buf[0];

  struct gb_usb_device {

greybus-dev mailing list -- greybus-dev@xxxxxxxxxxxxxxxx
To unsubscribe send an email to greybus-dev-leave@xxxxxxxxxxxxxxxx

[Index of Archives]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]     [Asterisk Books]

  Powered by Linux