]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cxgb4: Avoid a -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 4 Feb 2025 02:54:31 +0000 (13:24 +1030)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Feb 2025 02:16:30 +0000 (18:16 -0800)
-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>
Link: https://patch.msgid.link/Z6GBZ4brXYffLkt_@kspp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

index c7c2c15a18155e5e459eff3a3348e771a5c0a858..95e6f015a6af062c82f28ca15c62a87d80913ff2 100644 (file)
@@ -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