]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
geneve: constify geneve_hlen()
authorPaolo Abeni <pabeni@redhat.com>
Wed, 21 Jan 2026 16:11:31 +0000 (17:11 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 23 Jan 2026 19:31:14 +0000 (11:31 -0800)
Such helper does not modify the argument; constifying it will additionally
simplify later patches.

Additionally move the definition earlier, still for later's patchesi sake.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Link: https://patch.msgid.link/ea9e279b9544e8644194508dd9a4320ee455fa95.1769011015.git.pabeni@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/geneve.c

index 8719ad66837eeea394c0b35a328ef4e6f256b466..e99fa8c37486b21a1f1fb9883484fa695e7af742 100644 (file)
@@ -365,6 +365,11 @@ static void geneve_uninit(struct net_device *dev)
        gro_cells_destroy(&geneve->gro_cells);
 }
 
+static int geneve_hlen(const struct genevehdr *gh)
+{
+       return sizeof(*gh) + gh->opt_len * 4;
+}
+
 /* Callback from net/ipv4/udp.c to receive packets */
 static int geneve_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
 {
@@ -497,11 +502,6 @@ static struct socket *geneve_create_sock(struct net *net, bool ipv6,
        return sock;
 }
 
-static int geneve_hlen(struct genevehdr *gh)
-{
-       return sizeof(*gh) + gh->opt_len * 4;
-}
-
 static struct sk_buff *geneve_gro_receive(struct sock *sk,
                                          struct list_head *head,
                                          struct sk_buff *skb)