Skip to contentSkip to conversation

net: atlantic: Avoid -Wflex-array-member-not-at-end warnings

PATCH Applied Gustavo A. R. Silva 5 participants 5 messages Feb 4, 2025 – Feb 5, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: atlantic: Avoid -Wflex-array-member-not-at-end warnings

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Remove unused flexible-array member buf and, with this, fix the following
warnings:
drivers/net/ethernet/aquantia/atlantic/aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/net/ethernet/aquantia/atlantic/hw_atl/../aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

---
Changes in v2:
- Remove unused flex-array member. (Igor)

v1:
- Link: https://lore.kernel.org/linux-hardening/ZrDwoVKH8d6TdVxn@cute/

 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +0 -1
index f5901f8e3907..f6b990b7f5b4 100644
@@ -226,7 +226,6 @@ struct __packed offload_info {
 	struct offload_port_info ports;
 	struct offload_ka_info kas;
 	struct offload_rr_info rrs;
-	u8 buf[];
 };
 
 struct __packed hw_atl_utils_fw_rpc {
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 25 lines · Gustavo A. R. Silva

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Remove unused flexible-array member buf and, with this, fix the following
warnings:
drivers/net/ethernet/aquantia/atlantic/aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/net/ethernet/aquantia/atlantic/hw_atl/../aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

---
Changes in v2:
- Remove unused flex-array member. (Igor)

v1:
- Link: https://lore.kernel.org/linux-hardening/ZrDwoVKH8d6TdVxn@cute/

 drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h | 1 -
 1 file changed, 1 deletion(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +0 -0
index f5901f8e3907..f6b990b7f5b4 100644

drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h struct __packed offload_info { · line 229

Quoted 5 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +0 -1
@@ -226,7 +226,6 @@ struct __packed offload_info {
 	struct offload_port_info ports;
 	struct offload_ka_info kas;
 	struct offload_rr_info rrs;
-	u8 buf[];
 };
Quoted 5 lines
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +0 -0
 struct __packed hw_atl_utils_fw_rpc {
Signature · 1 line
2.43.0
reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 8 lines · Gustavo A. R. Silva

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Remove unused flexible-array member buf and, with this, fix the following
warnings:
drivers/net/ethernet/aquantia/atlantic/aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/net/ethernet/aquantia/atlantic/hw_atl/../aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Quoted 8 lines

---
Changes in v2:
- Remove unused flex-array member. (Igor)

v1:
- Link: https://lore.kernel.org/linux-hardening/ZrDwoVKH8d6TdVxn@cute/

Reviewed-by on v2 1/1
#3 lore raw
In reply to Gustavo A. R. Silva
Quoted 2 lines

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Remove unused flexible-array member buf and, with this, fix the following warnings: drivers/net/ethernet/aquantia/atlantic/aq_hw. h: 197: 36:
Remove unused flexible-array member buf and, with this, fix the following

Thanks, Gustavo, for posting this.

Igor

#4 lore raw
In reply to Gustavo A. R. Silva
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Tue, 4 Feb 2025 12:40:49 +1030 you wrote:

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally.

Remove unused flexible-array member buf and, with this, fix the following
warnings:
drivers/net/ethernet/aquantia/atlantic/aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] drivers/net/ethernet/aquantia/atlantic/hw_atl/../aq_hw.h:197:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

[...]

Here is the summary with links:
- [v2,next] net: atlantic: Avoid -Wflex-array-member-not-at-end warnings

    https://git.kernel.org/netdev/net-next/c/33b565fa2bc0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html