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