Skip to contentSkip to conversation

wifi: ath11k: Fix ath11k_htc_record flexible record

PATCH In review Jeff Johnson 4 participants 5 messages Dec 5, 2023 – Dec 12, 2023 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 wifi: ath11k: Fix ath11k_htc_record flexible record

Transform the zero-length ath11k_htc_record::credit_report array into a proper flexible array. Since this is the only array in ath11k_htc_record, remove the unnecessary union.

---
Changes in v2:
- Original patches 1/4 2/4 3/4 already accepted
- This is original patch 4/4, updated to incorporate Gustavo's review
comment, removing the union and just do a direct transformation
[0] -> [ ]
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 drivers/net/wireless/ath/ath11k/htc.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/htc.h +1 -3
index d5864a35e75b..86f77eacaea7 100644
@@ -151,9 +151,7 @@ struct ath11k_htc_credit_report {
 
 struct ath11k_htc_record {
 	struct ath11k_htc_record_hdr hdr;
-	union {
-		struct ath11k_htc_credit_report credit_report[0];
-	};
+	struct ath11k_htc_credit_report credit_report[];
 } __packed __aligned(4);
 
 enum ath11k_htc_svc_gid {

---
base-commit: c8a5f34ad811743d1b3aeb5c54198eebd413bc6d
change-id: 20231116-flexarray-htc_record-ae46f039d4bf

Reviewed-by on v2 1/1
#1 lore raw
Quoted 5 lines · Jeff Johnson

Transform the zero-length ath11k_htc_record::credit_report array into a proper flexible array. Since this is the only array in ath11k_htc_record, remove the unnecessary union.

Thanks!
--
Gustavo

Quoted 31 lines

---
Changes in v2:
- Original patches 1/4 2/4 3/4 already accepted
- This is original patch 4/4, updated to incorporate Gustavo's review
comment, removing the union and just do a direct transformation
[0] -> [ ]
- Link to v1: https://lore.kernel.org/r/[email protected]

---
  drivers/net/wireless/ath/ath11k/htc.h | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/wireless/ath/ath11k/htc.h +1 -4
index d5864a35e75b..86f77eacaea7 100644
@@ -151,9 +151,7 @@ struct ath11k_htc_credit_report {
 
  struct ath11k_htc_record {
  	struct ath11k_htc_record_hdr hdr;
-	union {
-		struct ath11k_htc_credit_report credit_report[0];
-	};
+	struct ath11k_htc_credit_report credit_report[];
  } __packed __aligned(4);
 
  enum ath11k_htc_svc_gid {
 
---

base-commit: c8a5f34ad811743d1b3aeb5c54198eebd413bc6d
change-id: 20231116-flexarray-htc_record-ae46f039d4bf

#3 lore raw
Quoted 8 lines · Kees Cook
Quoted 5 lines · Jeff Johnson

Transform the zero-length ath11k_htc_record::credit_report array into a proper flexible array. Since this is the only array in ath11k_htc_record, remove the unnecessary union.

Heh, looks good. I wonder why this was a union to begin with?

It used to contain a couple of members:

https://lore.kernel.org/linux-wireless/[email protected]/
https://lore.kernel.org/linux-wireless/[email protected]/

--
Gustavo

Quoted 3 lines
#4 lore raw
In reply to Jeff Johnson
Quoted 8 lines · Jeff Johnson

Transform the zero-length ath11k_htc_record::credit_report array into a proper flexible array. Since this is the only array in ath11k_htc_record, remove the unnecessary union.

Patch applied to ath-next branch of ath.git, thanks.

add731385eed wifi: ath11k: Fix ath11k_htc_record flexible record

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches