linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] wifi: ath*: use DECLARE_FLEX_ARRAY() for ath*_htc_record
@ 2023-11-27 16:14 Jeff Johnson
  2023-11-27 16:14 ` [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[] Jeff Johnson
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jeff Johnson @ 2023-11-27 16:14 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel, Jeff Johnson

Fix ath10k_htc_record and ath11k_htc_record to remove an unused (and
misspelled) pauload member and to correctly use DECLARE_FLEX_ARRAY()
for the remaining flexible arrays. This helps with ongoing efforts to
globally enable -Warray-bounds.

---
Jeff Johnson (4):
      wifi: ath10k: remove ath10k_htc_record::pauload[]
      wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record
      wifi: ath11k: remove ath11k_htc_record::pauload[]
      wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record

 drivers/net/wireless/ath/ath10k/htc.h | 7 +++----
 drivers/net/wireless/ath/ath11k/htc.h | 3 +--
 2 files changed, 4 insertions(+), 6 deletions(-)
---
base-commit: 8f157593689fcffc2d9b18af9472fce764188b43
change-id: 20231116-flexarray-htc_record-ae46f039d4bf


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[]
  2023-11-27 16:14 [PATCH 0/4] wifi: ath*: use DECLARE_FLEX_ARRAY() for ath*_htc_record Jeff Johnson
@ 2023-11-27 16:14 ` Jeff Johnson
  2023-11-30 17:02   ` Kalle Valo
  2023-11-27 16:14 ` [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record Jeff Johnson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnson @ 2023-11-27 16:14 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel, Jeff Johnson

The misspelled pauload member of struct ath10k_htc_record is unused,
so remove it.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
 drivers/net/wireless/ath/ath10k/htc.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index 0d180faf3b77..9cbb901d35e5 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -249,7 +249,6 @@ struct ath10k_htc_record {
 		struct ath10k_htc_credit_report credit_report[0];
 		struct ath10k_htc_lookahead_report lookahead_report[0];
 		struct ath10k_htc_lookahead_bundle lookahead_bundle[0];
-		u8 pauload[0];
 	};
 } __packed __aligned(4);
 

-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record
  2023-11-27 16:14 [PATCH 0/4] wifi: ath*: use DECLARE_FLEX_ARRAY() for ath*_htc_record Jeff Johnson
  2023-11-27 16:14 ` [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[] Jeff Johnson
@ 2023-11-27 16:14 ` Jeff Johnson
  2023-11-27 16:24   ` Gustavo A. R. Silva
  2023-11-27 16:14 ` [PATCH 3/4] wifi: ath11k: remove ath11k_htc_record::pauload[] Jeff Johnson
  2023-11-27 16:14 ` [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record Jeff Johnson
  3 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnson @ 2023-11-27 16:14 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel, Jeff Johnson

Transform the zero-length arrays in ath10k_htc_record into proper
flexible arrays 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/ath10k/htc.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
index 9cbb901d35e5..c6c392f8630c 100644
--- a/drivers/net/wireless/ath/ath10k/htc.h
+++ b/drivers/net/wireless/ath/ath10k/htc.h
@@ -246,9 +246,9 @@ struct ath10k_htc_lookahead_bundle {
 struct ath10k_htc_record {
 	struct ath10k_ath10k_htc_record_hdr hdr;
 	union {
-		struct ath10k_htc_credit_report credit_report[0];
-		struct ath10k_htc_lookahead_report lookahead_report[0];
-		struct ath10k_htc_lookahead_bundle lookahead_bundle[0];
+		DECLARE_FLEX_ARRAY(struct ath10k_htc_credit_report, credit_report);
+		DECLARE_FLEX_ARRAY(struct ath10k_htc_lookahead_report, lookahead_report);
+		DECLARE_FLEX_ARRAY(struct ath10k_htc_lookahead_bundle, lookahead_bundle);
 	};
 } __packed __aligned(4);
 

-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/4] wifi: ath11k: remove ath11k_htc_record::pauload[]
  2023-11-27 16:14 [PATCH 0/4] wifi: ath*: use DECLARE_FLEX_ARRAY() for ath*_htc_record Jeff Johnson
  2023-11-27 16:14 ` [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[] Jeff Johnson
  2023-11-27 16:14 ` [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record Jeff Johnson
@ 2023-11-27 16:14 ` Jeff Johnson
  2023-11-27 16:14 ` [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record Jeff Johnson
  3 siblings, 0 replies; 12+ messages in thread
From: Jeff Johnson @ 2023-11-27 16:14 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel, Jeff Johnson

The misspelled pauload member of struct ath11k_htc_record is unused,
so remove it.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/htc.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/htc.h b/drivers/net/wireless/ath/ath11k/htc.h
index d31e501c807c..84971cc9251c 100644
--- a/drivers/net/wireless/ath/ath11k/htc.h
+++ b/drivers/net/wireless/ath/ath11k/htc.h
@@ -152,7 +152,6 @@ struct ath11k_htc_record {
 	struct ath11k_htc_record_hdr hdr;
 	union {
 		struct ath11k_htc_credit_report credit_report[0];
-		u8 pauload[0];
 	};
 } __packed __aligned(4);
 

-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
  2023-11-27 16:14 [PATCH 0/4] wifi: ath*: use DECLARE_FLEX_ARRAY() for ath*_htc_record Jeff Johnson
                   ` (2 preceding siblings ...)
  2023-11-27 16:14 ` [PATCH 3/4] wifi: ath11k: remove ath11k_htc_record::pauload[] Jeff Johnson
@ 2023-11-27 16:14 ` Jeff Johnson
  2023-11-27 16:23   ` Gustavo A. R. Silva
  3 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnson @ 2023-11-27 16:14 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel, Jeff Johnson

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);
 	};
 } __packed __aligned(4);
 

-- 
2.42.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
  2023-11-27 16:14 ` [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record Jeff Johnson
@ 2023-11-27 16:23   ` Gustavo A. R. Silva
  2023-11-27 16:32     ` Jeff Johnson
  0 siblings, 1 reply; 12+ messages in thread
From: Gustavo A. R. Silva @ 2023-11-27 16:23 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel



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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record
  2023-11-27 16:14 ` [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record Jeff Johnson
@ 2023-11-27 16:24   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 12+ messages in thread
From: Gustavo A. R. Silva @ 2023-11-27 16:24 UTC (permalink / raw)
  To: Jeff Johnson, Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel



On 11/27/23 10:14, Jeff Johnson wrote:
> Transform the zero-length arrays in ath10k_htc_record into proper
> flexible arrays 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>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks
--
Gustavo

> ---
>   drivers/net/wireless/ath/ath10k/htc.h | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h
> index 9cbb901d35e5..c6c392f8630c 100644
> --- a/drivers/net/wireless/ath/ath10k/htc.h
> +++ b/drivers/net/wireless/ath/ath10k/htc.h
> @@ -246,9 +246,9 @@ struct ath10k_htc_lookahead_bundle {
>   struct ath10k_htc_record {
>   	struct ath10k_ath10k_htc_record_hdr hdr;
>   	union {
> -		struct ath10k_htc_credit_report credit_report[0];
> -		struct ath10k_htc_lookahead_report lookahead_report[0];
> -		struct ath10k_htc_lookahead_bundle lookahead_bundle[0];
> +		DECLARE_FLEX_ARRAY(struct ath10k_htc_credit_report, credit_report);
> +		DECLARE_FLEX_ARRAY(struct ath10k_htc_lookahead_report, lookahead_report);
> +		DECLARE_FLEX_ARRAY(struct ath10k_htc_lookahead_bundle, lookahead_bundle);
>   	};
>   } __packed __aligned(4);
>   
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
  2023-11-27 16:23   ` Gustavo A. R. Silva
@ 2023-11-27 16:32     ` Jeff Johnson
  2023-12-05 15:29       ` Kalle Valo
  0 siblings, 1 reply; 12+ messages in thread
From: Jeff Johnson @ 2023-11-27 16:32 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Kalle Valo
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel

On 11/27/2023 8:23 AM, Gustavo A. R. Silva wrote:
> 
> 
> 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] -> [ ] ?

No reason other than staying consistent with ath10k.
Will see if Kalle has an opinion on this.

/jeff

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[]
  2023-11-27 16:14 ` [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[] Jeff Johnson
@ 2023-11-30 17:02   ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2023-11-30 17:02 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel, Jeff Johnson

Jeff Johnson <quic_jjohnson@quicinc.com> wrote:

> The misspelled pauload member of struct ath10k_htc_record is unused,
> so remove it.
> 
> Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

3 patches applied to ath-next branch of ath.git, thanks.

c7876faa91ab wifi: ath10k: remove ath10k_htc_record::pauload[]
7b4df59fced0 wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record
f20eb4cb9324 wifi: ath11k: remove ath11k_htc_record::pauload[]

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20231127-flexarray-htc_record-v1-1-6be1f36126fd@quicinc.com/

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
  2023-11-27 16:32     ` Jeff Johnson
@ 2023-12-05 15:29       ` Kalle Valo
  2023-12-05 15:45         ` Gustavo A. R. Silva
  0 siblings, 1 reply; 12+ messages in thread
From: Kalle Valo @ 2023-12-05 15:29 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Gustavo A. R. Silva, Gustavo A. R. Silva, Kees Cook, ath10k,
	ath11k, linux-wireless, linux-kernel

Jeff Johnson <quic_jjohnson@quicinc.com> writes:

> On 11/27/2023 8:23 AM, Gustavo A. R. Silva wrote:
>
>> 
>> 
>> 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] -> [ ] ?
>
> No reason other than staying consistent with ath10k.
> Will see if Kalle has an opinion on this.

Yeah, I don't see the need for the union and I removed it in the pending
branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=a2faeea1fe0635563187e7821a6d0baf7b40f2c6

Does it look ok?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
  2023-12-05 15:29       ` Kalle Valo
@ 2023-12-05 15:45         ` Gustavo A. R. Silva
  2023-12-05 20:00           ` Kalle Valo
  0 siblings, 1 reply; 12+ messages in thread
From: Gustavo A. R. Silva @ 2023-12-05 15:45 UTC (permalink / raw)
  To: Kalle Valo, Jeff Johnson
  Cc: Gustavo A. R. Silva, Kees Cook, ath10k, ath11k, linux-wireless,
	linux-kernel



On 12/5/23 09:29, Kalle Valo wrote:
> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
> 
>> On 11/27/2023 8:23 AM, Gustavo A. R. Silva wrote:
>>
>>>
>>>
>>> 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] -> [ ] ?
>>
>> No reason other than staying consistent with ath10k.
>> Will see if Kalle has an opinion on this.
> 
> Yeah, I don't see the need for the union and I removed it in the pending
> branch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=a2faeea1fe0635563187e7821a6d0baf7b40f2c6
> 
> Does it look ok?
> 

Nope.

A direct transformation is just fine:

-	union {
-		struct ath11k_htc_credit_report credit_report[0];
-	};
+	struct ath11k_htc_credit_report credit_report[];

There is no need for DFA in this situation.

Thanks
--
Gustavo

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
  2023-12-05 15:45         ` Gustavo A. R. Silva
@ 2023-12-05 20:00           ` Kalle Valo
  0 siblings, 0 replies; 12+ messages in thread
From: Kalle Valo @ 2023-12-05 20:00 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Jeff Johnson, Gustavo A. R. Silva, Kees Cook, ath10k, ath11k,
	linux-wireless, linux-kernel

"Gustavo A. R. Silva" <gustavo@embeddedor.com> writes:

> On 12/5/23 09:29, Kalle Valo wrote:
>> Jeff Johnson <quic_jjohnson@quicinc.com> writes:
>> 
>>> On 11/27/2023 8:23 AM, Gustavo A. R. Silva wrote:
>>>
>>>>
>>>>
>>>> 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] -> [ ] ?
>>>
>>> No reason other than staying consistent with ath10k.
>>> Will see if Kalle has an opinion on this.
>> Yeah, I don't see the need for the union and I removed it in the
>> pending
>> branch:
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=a2faeea1fe0635563187e7821a6d0baf7b40f2c6
>> Does it look ok?
>> 
>
> Nope.
>
> A direct transformation is just fine:
>
> -	union {
> -		struct ath11k_htc_credit_report credit_report[0];
> -	};
> +	struct ath11k_htc_credit_report credit_report[];
>
> There is no need for DFA in this situation.

Sorry, I read your comments too hastily. Jeff, as I'm offline tomorrow
would you mind submitting v2?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-05 20:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-27 16:14 [PATCH 0/4] wifi: ath*: use DECLARE_FLEX_ARRAY() for ath*_htc_record Jeff Johnson
2023-11-27 16:14 ` [PATCH 1/4] wifi: ath10k: remove ath10k_htc_record::pauload[] Jeff Johnson
2023-11-30 17:02   ` Kalle Valo
2023-11-27 16:14 ` [PATCH 2/4] wifi: ath10k: Use DECLARE_FLEX_ARRAY() for ath10k_htc_record Jeff Johnson
2023-11-27 16:24   ` Gustavo A. R. Silva
2023-11-27 16:14 ` [PATCH 3/4] wifi: ath11k: remove ath11k_htc_record::pauload[] Jeff Johnson
2023-11-27 16:14 ` [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record Jeff Johnson
2023-11-27 16:23   ` Gustavo A. R. Silva
2023-11-27 16:32     ` Jeff Johnson
2023-12-05 15:29       ` Kalle Valo
2023-12-05 15:45         ` Gustavo A. R. Silva
2023-12-05 20:00           ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).