lkml.org 
[lkml]   [2023]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
From


On 11/27/23 10:14, Jeff Johnson wrote:
> Transform the zero-length array in ath11k_htc_record into a proper
> flexible array via the DECLARE_FLEX_ARRAY() macro. This helps with
> ongoing efforts to globally enable -Warray-bounds.
>
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> ---
> drivers/net/wireless/ath/ath11k/htc.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/htc.h b/drivers/net/wireless/ath/ath11k/htc.h
> index 84971cc9251c..e0434b29df70 100644
> --- a/drivers/net/wireless/ath/ath11k/htc.h
> +++ b/drivers/net/wireless/ath/ath11k/htc.h
> @@ -151,7 +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];
> + DECLARE_FLEX_ARRAY(struct ath11k_htc_credit_report, credit_report);
> };

Why not removing the `union` and just do a direct transformation [0] -> [ ] ?

--
Gustavo

\
 
 \ /
  Last update: 2023-11-27 17:24    [W:0.071 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site