]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: airoha: Avoid -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 22 Sep 2025 14:08:21 +0000 (16:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Sep 2025 23:52:42 +0000 (16:52 -0700)
-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 corresponding
structure. Notice that `struct airoha_foe_entry` is a flexible
structure, this is a structure that contains a flexible-array
member.

Fix the following warning:

drivers/net/ethernet/airoha/airoha_eth.h:474:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/aNFYVYLXQDqm4yxb@kspp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/airoha/airoha_eth.h

index 77fd13d466dcd235a3ab39a488aa26d8f793cf77..cd13c1c1224f64b63d455b24ce722c33c2fa7125 100644 (file)
@@ -471,7 +471,6 @@ struct airoha_flow_table_entry {
                };
        };
 
-       struct airoha_foe_entry data;
        struct hlist_node l2_subflow_node; /* PPE L2 subflow entry */
        u32 hash;
 
@@ -480,6 +479,9 @@ struct airoha_flow_table_entry {
 
        struct rhash_head node;
        unsigned long cookie;
+
+       /* Must be last --ends in a flexible-array member. */
+       struct airoha_foe_entry data;
 };
 
 struct airoha_wdma_info {