* [PATCH v2][next] cxgb4: Avoid a -Wflex-array-member-not-at-end warning
@ 2025-02-04 2:54 Gustavo A. R. Silva
2025-02-06 2:30 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2025-02-04 2:54 UTC (permalink / raw)
To: Potnuri Bharat Teja, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman
Cc: netdev, linux-kernel, Gustavo A. R. Silva, linux-hardening
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.
Move the conflicting declaration to the end of the structure. Notice
that `struct ethtool_dump` is a flexible structure --a structure that
contains a flexible-array member.
Fix the following warning:
./drivers/net/ethernet/chelsio/cxgb4/cxgb4.h:1215:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v2:
- Update subject and prefix.
- Add RB tag.
v1:
- Link: https://lore.kernel.org/linux-hardening/ZrDx4Jii7XfuOPfC@cute/
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index c7c2c15a1815..95e6f015a6af 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -1211,9 +1211,6 @@ struct adapter {
struct timer_list flower_stats_timer;
struct work_struct flower_stats_work;
- /* Ethtool Dump */
- struct ethtool_dump eth_dump;
-
/* HMA */
struct hma_data hma;
@@ -1233,6 +1230,10 @@ struct adapter {
/* Ethtool n-tuple */
struct cxgb4_ethtool_filter *ethtool_filters;
+
+ /* Ethtool Dump */
+ /* Must be last - ends in a flex-array member. */
+ struct ethtool_dump eth_dump;
};
/* Support for "sched-class" command to allow a TX Scheduling Class to be
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2][next] cxgb4: Avoid a -Wflex-array-member-not-at-end warning
2025-02-04 2:54 [PATCH v2][next] cxgb4: Avoid a -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
@ 2025-02-06 2:30 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-06 2:30 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: bharat, andrew+netdev, davem, edumazet, kuba, pabeni, horms,
netdev, linux-kernel, linux-hardening
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 4 Feb 2025 13:24:31 +1030 you wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
>
> Move the conflicting declaration to the end of the structure. Notice
> that `struct ethtool_dump` is a flexible structure --a structure that
> contains a flexible-array member.
>
> [...]
Here is the summary with links:
- [v2,next] cxgb4: Avoid a -Wflex-array-member-not-at-end warning
https://git.kernel.org/netdev/net-next/c/863257c29fe9
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-02-06 2:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 2:54 [PATCH v2][next] cxgb4: Avoid a -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-02-06 2:30 ` patchwork-bot+netdevbpf
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).