The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jeremy Dean <deaner92@yahoo.com>
To: Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Markus Elfring <Markus.Elfring@web.de>,
	Jeremy Dean <deaner92@yahoo.com>
Subject: [PATCH v3] Bluetooth: Fix code style error
Date: Tue, 25 Aug 2026 12:22:07 +0000	[thread overview]
Message-ID: <20260825122207.101868-1-deaner92@yahoo.com> (raw)
In-Reply-To: 20260825122207.101868-1-deaner92.ref@yahoo.com

checkpatch.pl flags the zero-length array members in struct
qca_dump_hdr:

    ERROR: Use C99 flexible arrays - see
    https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
    #3110: FILE: drivers/bluetooth/btusb.c:3110:
    + u8 data0[0];

Replace them with DECLARE_FLEX_ARRAY(), since C99 flexible array
members are not permitted inside unions or as the sole member of
a struct.

The struct layout is unchanged, and everything compiles with the
change.

Link: https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
Signed-off-by: Jeremy Dean <deaner92@yahoo.com>
---
 drivers/bluetooth/btusb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 8f7ed469cac6..b78c4a0e75fd 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3103,10 +3103,10 @@ struct qca_dump_hdr {
 	__le16 seqno;
 	u8 reserved;
 	union {
-		u8 data[0];
+		DECLARE_FLEX_ARRAY(u8, data);
 		struct {
 			__le32 ram_dump_size;
-			u8 data0[0];
+			DECLARE_FLEX_ARRAY(u8, data0);
 		} __packed;
 	};
 } __packed;
-- 
2.43.0


       reply	other threads:[~2026-08-25 13:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260825122207.101868-1-deaner92.ref@yahoo.com>
2026-08-25 12:22 ` Jeremy Dean [this message]
2026-08-25 12:52   ` [PATCH v3] Bluetooth: Fix code style error Markus Elfring

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=20260825122207.101868-1-deaner92@yahoo.com \
    --to=deaner92@yahoo.com \
    --cc=Markus.Elfring@web.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.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