Commit be812ace authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Luiz Augusto von Dentz
Browse files

Bluetooth: Avoid a couple dozen -Wflex-array-member-not-at-end warnings



-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Use the __struct_group() helper to fix 31 instances of the following
type of warnings:

30 net/bluetooth/mgmt_config.c:16:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
1 net/bluetooth/mgmt_config.c:22:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent 03ddb4ac
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -53,10 +53,15 @@ struct mgmt_hdr {
} __packed;

struct mgmt_tlv {
	/* New members MUST be added within the __struct_group() macro below. */
	__struct_group(mgmt_tlv_hdr, __hdr, __packed,
		__le16 type;
		__u8   length;
	);
	__u8   value[];
} __packed;
static_assert(offsetof(struct mgmt_tlv, value) == sizeof(struct mgmt_tlv_hdr),
	      "struct member likely outside of __struct_group()");

struct mgmt_addr_info {
	bdaddr_t	bdaddr;
+2 −2
Original line number Diff line number Diff line
@@ -13,13 +13,13 @@

#define HDEV_PARAM_U16(_param_name_) \
	struct {\
		struct mgmt_tlv entry; \
		struct mgmt_tlv_hdr entry; \
		__le16 value; \
	} __packed _param_name_

#define HDEV_PARAM_U8(_param_name_) \
	struct {\
		struct mgmt_tlv entry; \
		struct mgmt_tlv_hdr entry; \
		__u8 value; \
	} __packed _param_name_