Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2568936pxf; Sun, 14 Mar 2021 04:15:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyk5HjP8/HCUXG7zKZZYow190htI6x0SN+SIHyQ5Mpv2H7pNP5xmVktav60wv/17MKGhGOz X-Received: by 2002:aa7:c386:: with SMTP id k6mr24009114edq.224.1615720533725; Sun, 14 Mar 2021 04:15:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615720533; cv=none; d=google.com; s=arc-20160816; b=XNU/KpygRJlgV1BchnSXI0fa453T1Xv3yfdk2kKvRJNivlo2gqajyJpiCzMJoV8Gw/ +2UA7TYIg1wYAu5dNODDf5Wjv40X7JGShEjlA5Pe//gg4iTayZFTNFdWK9uheQ3LH0Xe WkW6cCtauQtsCdnCt73CFLYKbopvgVoB5oZHcOm823cMpsio/CoQwbKfSTIYnWmy901R uTvMi5lUTm7Nf2NPIJ4Z+FjNJ6ZLT2GAlNsLFSmhLKBbv/j0ttmAVkVOzsl/i9gZKtqb TKSNjqjhZq2FEy8teImbzAENkdNeC3UjYp3Ps86RNl32CnAer2eXd0SBNhwSHAf+i2eA mhXA== 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=BQ6O5zqHjGb+9zMeIlxYFyVk5fmqw6pHDXrg8PCLE6xFTL8puJsl9OebPYkPoSQhBb 2oiZ8pS4ja/YvvgIppt+Rfj6eBgBAI84eISkweHoaIgDQrUCVdQ9fOwBh1H3yZ0FmdwB IQU9G2K4BnjmnE+LKstAVWOxg7OKD6yZ2tmS2oQU4Z+NkYRwukNWT5xKQiPzpojKv+2B 485y+Mq+5ZHjIIxY075QZFrM6HBzLR+IOeCA0NDYcYXFTunuTj3FICGEaFhsHBqrBrqb PJvnb16B11owHBRefUppXOyi1pNMbFUi7MtV6uEBc9aLhz6QLg14D6GbwMgS55HlCbbK mZvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=PtqoU39f; 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 g18si8468980edv.353.2021.03.14.04.15.11; Sun, 14 Mar 2021 04:15:33 -0700 (PDT) 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=PtqoU39f; 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 S235377AbhCNLMS (ORCPT + 99 others); Sun, 14 Mar 2021 07:12:18 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:47771 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235205AbhCNLLt (ORCPT ); Sun, 14 Mar 2021 07:11:49 -0400 Date: Sun, 14 Mar 2021 11:11:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615720308; bh=OtoaEa4C9A8M8IjnX8ICb3j9vVq3aPxG0RyT+eIX9OU=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=PtqoU39fzNRS64KXipSkH/EEkC2cvGVmoElaAFxa9hDw2z1wnW5DRewaBcKQq/X4x ds8nrAsdpwJdnr0PvehU93XmH3+It1yXN95rGiYcMsymzpQTqXo2HWjUC1ZsTiryIv xnqnYim2AFwUmEsKvOF7jteUj3ElKlxBcjOSApo6iTx+rInJTmSeV8/Oc2ImPByOiJ jsnpOzRNOg37RRO0Uqup8hVWAcWgsh5jbbQWiqNS4zMVMBto8suLPe2//jy8Tuf1FG TnHJyW2Pwq6oWZMCJV1Bpq/H/IjcYPEIttWrFrrUJ1vnla8SLhWpKihFRbqQhvfmep 89D57l8unT9/Q== 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 v3 net-next 5/6] ethernet: constify eth_get_headlen()'s data argument Message-ID: <20210314111027.7657-6-alobakin@pm.me> In-Reply-To: <20210314111027.7657-1-alobakin@pm.me> References: <20210314111027.7657-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