* [PATCH v2] Bluetooth: Fix code style error
[not found] <20260825024148.101643-1-deaner92.ref@yahoo.com>
@ 2026-08-25 2:41 ` Jeremy Dean
0 siblings, 0 replies; only message in thread
From: Jeremy Dean @ 2026-08-25 2:41 UTC (permalink / raw)
To: Marcel Holtmann, Luiz Augusto von Dentz
Cc: linux-bluetooth, linux-kernel, Markus Elfring, Jeremy Dean
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 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-25 3:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20260825024148.101643-1-deaner92.ref@yahoo.com>
2026-08-25 2:41 ` [PATCH v2] Bluetooth: Fix code style error Jeremy Dean
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®