Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1972924pxf; Sat, 13 Mar 2021 03:46:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJxVNl7tWxafQfVXHHzIJ5AwLSWI+6cjCPvvu2s12Sz/e/no3nRmXKioZt/XhQvKQbx2+hj0 X-Received: by 2002:aa7:c456:: with SMTP id n22mr19220816edr.277.1615636001565; Sat, 13 Mar 2021 03:46:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615636001; cv=none; d=google.com; s=arc-20160816; b=mplsyClZmZ1lajdByjtLTSNFaykBnm9LFyghyfLULT3nko1l7UNGI3+ho+mZoSOu/J yGx/iFezGWizgSLzkFUbvzBOttyWumRGqFcx8jb1CUUGn3mekoW6PnM2qOvvb9LVLtzc 9dQP5mqxEL6vVW+NS2NOHUZPkhiZOZV5MeJlIL13xwXPbaUxTX5PupeGqr2VCSYYCChc xGjpMwgyQx/Xk57yFFuTI1ZWNTNr8H4ZSffBldlOqVcfpRJL4ggl8PgMoFWq2zjUssgv QdZLyvxehG+CGfLTzq4A0JUDHavyKXuqyzBtauH8Ww4tMqharoYeEPP9TP0VMOFjq5TM HlOw== 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=EIiFbrmD/indnpcTrZ7NYILlHLrlH6BrrsiydQMtKf0=; b=1CsNT+Dv9TsoObGziXRzUOuXgSrPpw3GqL3k/CTQxuyNEv48NL7qRmm0X/EfRROdLO MyDDuntJ0rl1wPHatICmAxMPs7doTln0R3F9mW0dWKqzApnE4JpmSF1FzyYFpKqsRUVf PpHLuWhs2xnW41wkGGhBTdUyFKunYmO3S5dg9KTDMOarKpX+EzTWrDoqo2G7Roa0ra1X ZeeCK73vi+E45cd9LSZQXpLJoQVIszNz83X2aPr6Zy8sVErEpoyqcY4EggHCmPw3VC/P JDSyTjJt48jsVNucncKlXKzzN4A3Y6kdw1pG16N+2ZrhSvRZ865KFo3iLa0vC0YGiahF jqoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=WKdqu0D8; 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 n7si6611993ejc.483.2021.03.13.03.46.13; Sat, 13 Mar 2021 03:46:41 -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=WKdqu0D8; 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 S233751AbhCMLiF (ORCPT + 99 others); Sat, 13 Mar 2021 06:38:05 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:61436 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233219AbhCMLhh (ORCPT ); Sat, 13 Mar 2021 06:37:37 -0500 Date: Sat, 13 Mar 2021 11:37:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615635455; bh=EIiFbrmD/indnpcTrZ7NYILlHLrlH6BrrsiydQMtKf0=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=WKdqu0D8cGyUsredOXFY+Cc7MKKPcIU5jqupM6RP6LBlyN9QX7T4OHYqkotQY55kc 5qMx02/7KpAH9JdVgUN4XywIdGnOg6TAw4QEKR7w9ia/PAT39UI7geGAfXq/L5+CDj UfwriMJI68TYt8BzpKc7g7mbkDv7+5YvgR88cYCUuM3kfP+C9eVnY+5CzaflJDC4l8 14u9vV86otX1QX7pFA1j8yQN4ozUKKqP3fO/PYGBod2GPRtGP+oyz8gPjLmM2jvrIB JzRahz7Z49N9IWl58D4ex6nAVR7pfvvyKR9kuqRyzc7p6l2IdxkXxzVxsSE4bfFJhe BINNQbTzr/RYA== 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 2/6] skbuff: make __skb_header_pointer()'s data argument const Message-ID: <20210313113645.5949-3-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 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