All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Kalle Valo <kvalo@kernel.org>, Jeff Johnson <quic_jjohnson@quicinc.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	ath10k@lists.infradead.org, ath11k@lists.infradead.org,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] wifi: ath11k: Use DECLARE_FLEX_ARRAY() for ath11k_htc_record
Date: Tue, 5 Dec 2023 09:45:57 -0600	[thread overview]
Message-ID: <30ea9d68-e49e-4727-88aa-547b1b0feebf@embeddedor.com> (raw)
In-Reply-To: <87edg0pt17.fsf@kernel.org>



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


  reply	other threads:[~2023-12-05 15:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-27 16:14 ` 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: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
2023-11-27 16:14   ` Jeff Johnson
2023-11-27 16:14   ` Jeff Johnson
2023-11-27 16:24   ` Gustavo A. R. Silva
2023-11-27 16:24     ` Gustavo A. R. Silva
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   ` 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
2023-11-27 16:14   ` Jeff Johnson
2023-11-27 16:14   ` Jeff Johnson
2023-11-27 16:23   ` Gustavo A. R. Silva
2023-11-27 16:23     ` Gustavo A. R. Silva
2023-11-27 16:23     ` Gustavo A. R. Silva
2023-11-27 16:32     ` Jeff Johnson
2023-11-27 16:32       ` Jeff Johnson
2023-11-27 16:32       ` Jeff Johnson
2023-12-05 15:29       ` Kalle Valo
2023-12-05 15:45         ` Gustavo A. R. Silva [this message]
2023-12-05 20:00           ` Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30ea9d68-e49e-4727-88aa-547b1b0feebf@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=ath10k@lists.infradead.org \
    --cc=ath11k@lists.infradead.org \
    --cc=gustavoars@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_jjohnson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.