[PATCH] Bluetooth: btusb: Use DECLARE_FLEX_ARRAY() for qca_dump_hdr

From: Jeremy Dean

Date: Tue Jul 28 2026 - 18:05:52 EST


Replace the deprecated zero-length array members in struct
qca_dump_hdr with DECLARE_FLEX_ARRAY(), since C99 flexible array
members are not permitted inside unions or as the sole member of
a struct.

Verified via offsetof()/sizeof() comparison that struct layout
(data/data0 offsets and overall size) is unchanged, and confirmed
the driver still compiles cleanly with the change.

Link: https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
Signed-off-by: Jeremy Dean <deaner92@xxxxxxxxx>
---
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