* [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record
@ 2023-12-05 21:00 Jeff Johnson
2023-12-05 21:05 ` Gustavo A. R. Silva
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jeff Johnson @ 2023-12-05 21:00 UTC (permalink / raw)
To: Kalle Valo
Cc: Gustavo A. R. Silva, Kees Cook, ath11k, linux-wireless,
linux-kernel, 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.
Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
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/20231127-flexarray-htc_record-v1-0-6be1f36126fd@quicinc.com
---
drivers/net/wireless/ath/ath11k/htc.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/htc.h b/drivers/net/wireless/ath/ath11k/htc.h
index d5864a35e75b..86f77eacaea7 100644
--- a/drivers/net/wireless/ath/ath11k/htc.h
+++ b/drivers/net/wireless/ath/ath11k/htc.h
@@ -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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record
2023-12-05 21:00 [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record Jeff Johnson
@ 2023-12-05 21:05 ` Gustavo A. R. Silva
2023-12-06 20:55 ` Kees Cook
2023-12-12 17:12 ` Kalle Valo
2 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2023-12-05 21:05 UTC (permalink / raw)
To: Jeff Johnson, Kalle Valo
Cc: Gustavo A. R. Silva, Kees Cook, ath11k, linux-wireless, linux-kernel
On 12/5/23 15:00, Jeff Johnson wrote:
> 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.
>
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Thanks!
--
Gustavo
> ---
> 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/20231127-flexarray-htc_record-v1-0-6be1f36126fd@quicinc.com
> ---
> drivers/net/wireless/ath/ath11k/htc.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/htc.h b/drivers/net/wireless/ath/ath11k/htc.h
> index d5864a35e75b..86f77eacaea7 100644
> --- a/drivers/net/wireless/ath/ath11k/htc.h
> +++ b/drivers/net/wireless/ath/ath11k/htc.h
> @@ -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
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record
2023-12-05 21:00 [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record Jeff Johnson
2023-12-05 21:05 ` Gustavo A. R. Silva
@ 2023-12-06 20:55 ` Kees Cook
2023-12-06 21:23 ` Gustavo A. R. Silva
2023-12-12 17:12 ` Kalle Valo
2 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2023-12-06 20:55 UTC (permalink / raw)
To: Jeff Johnson
Cc: Kalle Valo, Gustavo A. R. Silva, ath11k, linux-wireless, linux-kernel
On Tue, Dec 05, 2023 at 01:00:17PM -0800, Jeff Johnson wrote:
> 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.
>
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Heh, looks good. I wonder why this was a union to begin with?
Reviewed-by: Kees Cook <keescook@chromium.org>
--
Kees Cook
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record
2023-12-06 20:55 ` Kees Cook
@ 2023-12-06 21:23 ` Gustavo A. R. Silva
0 siblings, 0 replies; 5+ messages in thread
From: Gustavo A. R. Silva @ 2023-12-06 21:23 UTC (permalink / raw)
To: Kees Cook, Jeff Johnson
Cc: Kalle Valo, Gustavo A. R. Silva, ath11k, linux-wireless, linux-kernel
On 12/6/23 14:55, Kees Cook wrote:
> On Tue, Dec 05, 2023 at 01:00:17PM -0800, Jeff Johnson wrote:
>> 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.
>>
>> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>
> 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/20231127-flexarray-htc_record-v1-3-6be1f36126fd@quicinc.com/
https://lore.kernel.org/linux-wireless/4f2a486c-c6de-43e4-8bb6-bdd3f819b0a9@embeddedor.com/
--
Gustavo
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record
2023-12-05 21:00 [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record Jeff Johnson
2023-12-05 21:05 ` Gustavo A. R. Silva
2023-12-06 20:55 ` Kees Cook
@ 2023-12-12 17:12 ` Kalle Valo
2 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2023-12-12 17:12 UTC (permalink / raw)
To: Jeff Johnson
Cc: Gustavo A. R. Silva, Kees Cook, ath11k, linux-wireless,
linux-kernel, Jeff Johnson
Jeff Johnson <quic_jjohnson@quicinc.com> wrote:
> 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.
>
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> Reviewed-by: Kees Cook <keescook@chromium.org>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Patch applied to ath-next branch of ath.git, thanks.
add731385eed wifi: ath11k: Fix ath11k_htc_record flexible record
--
https://patchwork.kernel.org/project/linux-wireless/patch/20231205-flexarray-htc_record-v2-1-fbb56d436951@quicinc.com/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-12-12 17:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 21:00 [PATCH v2] wifi: ath11k: Fix ath11k_htc_record flexible record Jeff Johnson
2023-12-05 21:05 ` Gustavo A. R. Silva
2023-12-06 20:55 ` Kees Cook
2023-12-06 21:23 ` Gustavo A. R. Silva
2023-12-12 17:12 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®