1From 231312a3daf987ed248138d9f8298304b090fd87 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Tue, 5 May 2026 11:16:31 -0700
4Subject: [PATCH] Use preferred syntax location for struct attributes
5
6This aligns with the syntax for C23 attributes affecting struct/union
7types
8
9This is what is recommended in the gcc manual, and is supported by
10gcc all the way back to gcc 3.
11---
12 src/common/qca-vendor-attr.h | 8 ++++----
13 src/drivers/nl80211_copy.h | 16 ++++++++--------
14 2 files changed, 12 insertions(+), 12 deletions(-)
15
16diff --git a/src/common/qca-vendor-attr.h b/src/common/qca-vendor-attr.h
17index 6f51803e9..982d309f1 100644
18--- a/src/common/qca-vendor-attr.h
19+++ b/src/common/qca-vendor-attr.h
20@@ -15,14 +15,14 @@
21 * compiler dependencies.
22 */
23
24-struct qca_avoid_freq_range {
25+struct __attribute__ ((packed)) qca_avoid_freq_range {
26 u32 start_freq;
27 u32 end_freq;
28-} __attribute__ ((packed));
29+};
30
31-struct qca_avoid_freq_list {
32+struct __attribute__ ((packed)) qca_avoid_freq_list {
33 u32 count;
34 struct qca_avoid_freq_range range[0];
35-} __attribute__ ((packed));
36+};
37
38 #endif /* QCA_VENDOR_ATTR_H */
39diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
40index dced2c49d..9a8d6c163 100644
41--- a/src/drivers/nl80211_copy.h
42+++ b/src/drivers/nl80211_copy.h
43@@ -3545,10 +3545,10 @@ enum nl80211_sta_p2p_ps_status {
44 *
45 * Both mask and set contain bits as per &enum nl80211_sta_flags.
46 */
47-struct nl80211_sta_flag_update {
48+struct __attribute__((packed)) nl80211_sta_flag_update {
49 __u32 mask;
50 __u32 set;
51-} __attribute__((packed));
52+};
53
54 /**
55 * enum nl80211_he_gi - HE guard interval
56@@ -5556,12 +5556,12 @@ enum nl80211_packet_pattern_attr {
57 * %NL80211_ATTR_COALESCE_RULE in the capability information given
58 * by the kernel to userspace.
59 */
60-struct nl80211_pattern_support {
61+struct __attribute__((packed)) nl80211_pattern_support {
62 __u32 max_patterns;
63 __u32 min_pattern_len;
64 __u32 max_pattern_len;
65 __u32 max_pkt_offset;
66-} __attribute__((packed));
67+};
68
69 /* only for backward compatibility */
70 #define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
71@@ -5807,11 +5807,11 @@ enum nl80211_wowlan_tcp_attrs {
72 * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
73 * capability information given by the kernel to userspace.
74 */
75-struct nl80211_coalesce_rule_support {
76+struct __attribute__((packed)) nl80211_coalesce_rule_support {
77 __u32 max_rules;
78 struct nl80211_pattern_support pat;
79 __u32 max_delay;
80-} __attribute__((packed));
81+};
82
83 /**
84 * enum nl80211_attr_coalesce_rule - coalesce rule attribute
85@@ -6844,10 +6844,10 @@ enum nl80211_sched_scan_plan {
86 * of this field is according to &enum nl80211_band.
87 * @delta: value used to adjust the RSSI value of matching BSS in dB.
88 */
89-struct nl80211_bss_select_rssi_adjust {
90+struct __attribute__((packed)) nl80211_bss_select_rssi_adjust {
91 __u8 band;
92 __s8 delta;
93-} __attribute__((packed));
94+};
95
96 /**
97 * enum nl80211_bss_select_attr - attributes for bss selection.
98--
992.49.0
100