Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1975084pxf; Sat, 13 Mar 2021 03:52:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCSXtzjmePqpX6DyemhH7/Sp6f/P/F6EGhBh323Z8N0f+5w1EyJ4rB+a58UzEC8TZAOdw1 X-Received: by 2002:a17:906:5e4a:: with SMTP id b10mr13633626eju.116.1615636329359; Sat, 13 Mar 2021 03:52:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615636329; cv=none; d=google.com; s=arc-20160816; b=IM4nkKMnDzelvW3XdQZaO+ot8AqETI2X8ke0Qq6lA6cEgXRMpJ7Y3Aj3UPPyuOBhnQ 16KIVQ9QNd2pXzrGMECJDOTn1SgtJv9R7b7IVz4VaAWuHZvcPGHAux0nGFZc3I2PxMdC YFnlqlqS4NQzx4p64ESNZKxfFth5nJCmwSxlEmbdF9wCngkEXdUutlR45IoopTH0ysXs llThJpqyDGHSCPXyTeUKTK36o7vjtsR9nu+Zs3E8SyKLkBG5nyfJFKOufJL7mZmK+e8p huboMyPoVDM4u8UnxJG1eTH7o/V3tJPiBf2ksBTSJpeNAxZMRJflh9XcHr1qqrSjaSYn PgDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=OtoaEa4C9A8M8IjnX8ICb3j9vVq3aPxG0RyT+eIX9OU=; b=NGg0tSD2MZB0PJvbUBNIWTsb1br4vrVdq8uiRC/+57CayI7n+F4VqPvUY9giHTJmOy 3Vj50ZHZzCngfOgORG/1YCHfhAEtsjapuDjuQ+1HSdffuM8uNTTO/XTLQ6Jv7ttsgICk 86baS1HljdC7XQCTayKAoCw4XLwxG4VWBbX3oskR6Og02YZp/ufzDPQlUb9Bbn0wQxpY 5m9sdE88JTu2Tb7UZ1sJXMWzYU2b4bGkqS0OQhqvRFdL3pusZcSKYkI5hwuwMjPDROMP bvg0kXBKJ3zcn88LmyqxD265qzJ8yfC+p5HbHw3MoADkh/FMeOCou9Zw9bW1qpRhV7VA pBsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=RhSril2p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jz16si6447013ejb.586.2021.03.13.03.51.44; Sat, 13 Mar 2021 03:52:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=RhSril2p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233868AbhCMLiQ (ORCPT + 99 others); Sat, 13 Mar 2021 06:38:16 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:33376 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233409AbhCMLiB (ORCPT ); Sat, 13 Mar 2021 06:38:01 -0500 Date: Sat, 13 Mar 2021 11:37:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615635480; bh=OtoaEa4C9A8M8IjnX8ICb3j9vVq3aPxG0RyT+eIX9OU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=RhSril2pehoQYy1KfwPLC9d5QrYMJIunA0RHJamwEfQSDlhqhhGljeG7eMBtPCNYh afY60XcI2+6fh+Gm42ktHshPGWg4pqbSVTgQbpWX4NHvtcujf8bKUT/ecvmTsmcwLq FkWutvXXjuYgqLnWhvGT2SE9v/dJeSucNV3aMrTHYZlSYQB9vVScByJlIRw3zSGeIc XEyESqBtr/It3OpW2C/PB/ziNTGoWlnif7AMwd826H9ZQCLSGFOBt86dP2M9FUrf9M 0SalEn9UaJzXchaOgTGU+pTq9tP2ftf1todbPfcQnwRhkYUBvJPlFuU02IiQFDP9LI NaotVoi+2IXhg== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Jonathan Lemon , Alexander Lobakin , Eric Dumazet , Willem de Bruijn , Kevin Hao , Pablo Neira Ayuso , Jakub Sitnicki , Marco Elver , Dexuan Cui , Vladimir Oltean , Ariel Levkovich , Wang Qing , Davide Caratti , Guillaume Nault , Eran Ben Elisha , Mauro Carvalho Chehab , Kirill Tkhai , Bartosz Golaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH v2 net-next 5/6] ethernet: constify eth_get_headlen()'s @data argument Message-ID: <20210313113645.5949-6-alobakin@pm.me> In-Reply-To: <20210313113645.5949-1-alobakin@pm.me> References: <20210313113645.5949-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It's used only for flow dissection, which now takes constant data pointers. Signed-off-by: Alexander Lobakin --- include/linux/etherdevice.h | 2 +- net/ethernet/eth.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index bcb2f81baafb..330345b1be54 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -29,7 +29,7 @@ struct device; int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr); unsigned char *arch_get_platform_mac_address(void); int nvmem_get_mac_address(struct device *dev, void *addrbuf); -u32 eth_get_headlen(const struct net_device *dev, void *data, unsigned int= len); +u32 eth_get_headlen(const struct net_device *dev, const void *data, u32 le= n); __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); extern const struct header_ops eth_header_ops; diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index 4106373180c6..e01cf766d2c5 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -122,7 +122,7 @@ EXPORT_SYMBOL(eth_header); * Make a best effort attempt to pull the length for all of the headers fo= r * a given frame in a linear buffer. */ -u32 eth_get_headlen(const struct net_device *dev, void *data, unsigned int= len) +u32 eth_get_headlen(const struct net_device *dev, const void *data, u32 le= n) { =09const unsigned int flags =3D FLOW_DISSECTOR_F_PARSE_1ST_FRAG; =09const struct ethhdr *eth =3D (const struct ethhdr *)data; -- 2.30.2