Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp2567652pxf; Sun, 14 Mar 2021 04:13:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYFJ3UQiEx1d9guuC551h4xBz1mN1K3iOR8tiQyBboa0EviisOxXQMr45FYJ7dMhO+bwKg X-Received: by 2002:a17:906:14d4:: with SMTP id y20mr18349907ejc.190.1615720407820; Sun, 14 Mar 2021 04:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615720407; cv=none; d=google.com; s=arc-20160816; b=hWUq5+P77zBcNvhcjGAn3ou/dPOEYpkSSaPPF7BlXeqp22S5mgtAOOEEDE5ISvd4sa Ej1toIyyPbanWfAFt+ZkJ1w2rOQyrjQr4j37NIu4wYOtne33kaSG2XxtmPR8jZpHwhHJ Oz7rv0SIWlQDoKKozLwe3tbUU+/+Uzx+a00uvhn6anyxvwk7oMTox/lDFgrZ9ZZcCgKv nDfQrtqpWiGlmExxRDY3DKDpRv3qEzaz/PoswTOenOs3OtFp/azCnwCbVRg5/9tH9J+h hBY/u7uN3KMAO+Ewjbu5Onfo+Tmduq9Fa/uYoWTF8lVRvsrESp5nAJR528qg9rdclaCP Aihw== 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=KbKHs69Z30MoR2CtDmYVM6+lpepKa3puU+bMA1kdp8c=; b=oZGKvVtSsnc0WLwiVHnQLrr/d407FeuqlSscPNtVmopTTKmqMWLwyKb0TY/s93N1a8 QoczIBroQTTQyKLmg/BZJ2hb2OgI9txjFZMZIBUV+8th17TzahfhrT/94v+YP+wEG+aq 9aeV0fMlOvKTqjfN8ygDv9LoUvdrfwSmFJ7U90xEGSRRVsPaFRS6faSC6bVcbejQnxSa a99dEcwoUDbQUS+mUP3y4udgf0eVpRI6Kt1ittgFR0SvD9a72fB9ZtWmwv23eoV6WTgq UFjaWTV2New8S6Z7n66onEmdhx1C4WJufoHbXr5HQScTXXse1DMfIkfl2+w6xGwXuzjA a7Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=ZdCyRk1n; 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 g16si8802436ejf.96.2021.03.14.04.13.05; Sun, 14 Mar 2021 04:13:27 -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=ZdCyRk1n; 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 S235284AbhCNLLf (ORCPT + 99 others); Sun, 14 Mar 2021 07:11:35 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:55305 "EHLO mail-40133.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235224AbhCNLLU (ORCPT ); Sun, 14 Mar 2021 07:11:20 -0400 Date: Sun, 14 Mar 2021 11:11:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615720277; bh=KbKHs69Z30MoR2CtDmYVM6+lpepKa3puU+bMA1kdp8c=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=ZdCyRk1nOKrJG9lLfRFY2DXyTZAKrUppPS7VAtbmlZW5RfaBw4OV8z3FHGoTxIyT7 srv3DCI7hjaJILMJ9XOXoGAaAqhHLd4QM6UBj348vDscQ1JP78agr3WvekdPUkWfF/ iUbfuBD11PlYbQ3dFACoHmxr1XxTKW6X9BGFSsVnh9+D21LFybgWgMT8qemg+1NvbQ ksArYh3bbbYGsH7eN6PBPH8PKPSam6RrT/FOwo8eL/N/2SOrjxsOxmhqq6lDouCovP aa4pXInD4BGp2UxLpkTQFvTSJHw1zgJBLJ6QyVzYOtkQ9CqIgjlMw0WpNMSrLG25Xp F0LxaSBgOA4hQ== 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 2/6] skbuff: make __skb_header_pointer()'s data argument const Message-ID: <20210314111027.7657-3-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 The function never modifies the input buffer, so 'data' argument can be marked as const. This implies one harmless cast-away. Signed-off-by: Alexander Lobakin --- include/linux/skbuff.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 483e89348f78..d6ea3dc3eddb 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3678,11 +3678,11 @@ __wsum skb_checksum(const struct sk_buff *skb, int = offset, int len, =09=09 __wsum csum); static inline void * __must_check -__skb_header_pointer(const struct sk_buff *skb, int offset, -=09=09 int len, void *data, int hlen, void *buffer) +__skb_header_pointer(const struct sk_buff *skb, int offset, int len, +=09=09 const void *data, int hlen, void *buffer) { =09if (hlen - offset >=3D len) -=09=09return data + offset; +=09=09return (void *)data + offset; =09if (!skb || =09 skb_copy_bits(skb, offset, buffer, len) < 0) -- 2.30.2