All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] wifi: iwlwifi: mei: Remove unused flexible-array member in struct iwl_sap_hdr?
@ 2025-08-11  8:23 Gustavo A. R. Silva
  2025-08-25  8:20 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2025-08-11  8:23 UTC (permalink / raw)
  To: Miri Korenblit, Johannes Berg; +Cc: linux-wireless, linux-kernel

Hi all,

At first sight, it seems that the flexible-array member `payload`
in the struct below it's not being used:

drivers/net/wireless/intel/iwlwifi/mei/sap.h:
298 /**
299  * struct iwl_sap_hdr - prefixes any SAP message
300  * @type: See &enum iwl_sap_msg.
301  * @len: The length of the message (header not included).
302  * @seq_num: For debug.
303  * @payload: The payload of the message.
304  */
305 struct iwl_sap_hdr {
306         __le16 type;
307         __le16 len;
308         __le32 seq_num;
309         u8 payload[];
310 };

If we remove it, we'd get rid of 14 of the following type of warnings:

drivers/net/wireless/intel/iwlwifi/mei/sap.h:318:28: warning: structure containing a flexible array member is not at the end of another structure 
[-Wflex-array-member-not-at-end]

Is there any case where this array is actually used that I might
be missing?

Thanks!
-Gustavo

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

* Re: [RFC] wifi: iwlwifi: mei: Remove unused flexible-array member in struct iwl_sap_hdr?
  2025-08-11  8:23 [RFC] wifi: iwlwifi: mei: Remove unused flexible-array member in struct iwl_sap_hdr? Gustavo A. R. Silva
@ 2025-08-25  8:20 ` Johannes Berg
  2025-08-27  8:20   ` Gustavo A. R. Silva
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2025-08-25  8:20 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Miri Korenblit; +Cc: linux-wireless, linux-kernel

On Mon, 2025-08-11 at 17:23 +0900, Gustavo A. R. Silva wrote:
> Hi all,
> 
> At first sight, it seems that the flexible-array member `payload`
> in the struct below it's not being used:
> 
> drivers/net/wireless/intel/iwlwifi/mei/sap.h:
> 298 /**
> 299  * struct iwl_sap_hdr - prefixes any SAP message
> 300  * @type: See &enum iwl_sap_msg.
> 301  * @len: The length of the message (header not included).
> 302  * @seq_num: For debug.
> 303  * @payload: The payload of the message.
> 304  */
> 305 struct iwl_sap_hdr {
> 306         __le16 type;
> 307         __le16 len;
> 308         __le32 seq_num;
> 309         u8 payload[];
> 310 };
> 
> If we remove it, we'd get rid of 14 of the following type of warnings:
> 
> drivers/net/wireless/intel/iwlwifi/mei/sap.h:318:28: warning: structure containing a flexible array member is not at the end of another structure 
> [-Wflex-array-member-not-at-end]
> 
> Is there any case where this array is actually used that I might
> be missing?

Check if it builds? But I don't see it used in our internal (and
possibly more recent) version of this either.

johannes

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

* Re: [RFC] wifi: iwlwifi: mei: Remove unused flexible-array member in struct iwl_sap_hdr?
  2025-08-25  8:20 ` Johannes Berg
@ 2025-08-27  8:20   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2025-08-27  8:20 UTC (permalink / raw)
  To: Johannes Berg, Miri Korenblit; +Cc: linux-wireless, linux-kernel



On 25/08/25 10:20, Johannes Berg wrote:
> On Mon, 2025-08-11 at 17:23 +0900, Gustavo A. R. Silva wrote:
>> Hi all,
>>
>> At first sight, it seems that the flexible-array member `payload`
>> in the struct below it's not being used:
>>
>> drivers/net/wireless/intel/iwlwifi/mei/sap.h:
>> 298 /**
>> 299  * struct iwl_sap_hdr - prefixes any SAP message
>> 300  * @type: See &enum iwl_sap_msg.
>> 301  * @len: The length of the message (header not included).
>> 302  * @seq_num: For debug.
>> 303  * @payload: The payload of the message.
>> 304  */
>> 305 struct iwl_sap_hdr {
>> 306         __le16 type;
>> 307         __le16 len;
>> 308         __le32 seq_num;
>> 309         u8 payload[];
>> 310 };
>>
>> If we remove it, we'd get rid of 14 of the following type of warnings:
>>
>> drivers/net/wireless/intel/iwlwifi/mei/sap.h:318:28: warning: structure containing a flexible array member is not at the end of another structure
>> [-Wflex-array-member-not-at-end]
>>
>> Is there any case where this array is actually used that I might
>> be missing?
> 
> Check if it builds? But I don't see it used in our internal (and
> possibly more recent) version of this either.

It seems that the whole thing is actually broken, see commit 8997f5c8a627
("wifi: iwlwifi: Mark IWLMEI as broken").

However, nothing complains when built without that array. So, I've just
submitted a patch.

Thanks!
-Gustavo

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

end of thread, other threads:[~2025-08-27  8:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-11  8:23 [RFC] wifi: iwlwifi: mei: Remove unused flexible-array member in struct iwl_sap_hdr? Gustavo A. R. Silva
2025-08-25  8:20 ` Johannes Berg
2025-08-27  8:20   ` Gustavo A. R. Silva

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.