From: Paolo Abeni Date: Wed, 21 Jan 2026 16:11:31 +0000 (+0100) Subject: geneve: constify geneve_hlen() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=759b8d3cef7bfc0a69a11f260eb136bba1821ab4;p=thirdparty%2Fkernel%2Flinux.git geneve: constify geneve_hlen() 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 Link: https://patch.msgid.link/ea9e279b9544e8644194508dd9a4320ee455fa95.1769011015.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 8719ad66837ee..e99fa8c37486b 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -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)