]> www.infradead.org Git - users/hch/misc.git/commitdiff
geneve: Avoid -Wflex-array-member-not-at-end warning
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 9 Sep 2025 15:42:39 +0000 (17:42 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 12 Sep 2025 01:49:16 +0000 (18:49 -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 ip_tunnel_info` is a flexible
structure, this is a structure that contains a flexible-array
member.

Fix the following warning:

drivers/net/geneve.c:56: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: Andrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/aMBK78xT2fUnpwE5@kspp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/geneve.c

index 54384f9b387273af5ad3f5f9c9868d7f853d1797..77b0c3d52041405eaaa1fbd25fa14d2bbe5a123d 100644 (file)
@@ -53,7 +53,6 @@ struct geneve_dev_node {
 };
 
 struct geneve_config {
-       struct ip_tunnel_info   info;
        bool                    collect_md;
        bool                    use_udp6_rx_checksums;
        bool                    ttl_inherit;
@@ -61,6 +60,9 @@ struct geneve_config {
        bool                    inner_proto_inherit;
        u16                     port_min;
        u16                     port_max;
+
+       /* Must be last --ends in a flexible-array member. */
+       struct ip_tunnel_info   info;
 };
 
 /* Pseudo network device */