Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1531096pxf; Fri, 12 Mar 2021 11:48:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/Ejo1gH722ct8/pjQX/8PXGTrK0/P87uSsQzmNtuLgRlEhHjD8RmRRwkjC5/+ibJ0vjaZ X-Received: by 2002:a17:906:a155:: with SMTP id bu21mr10419502ejb.400.1615578508147; Fri, 12 Mar 2021 11:48:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615578508; cv=none; d=google.com; s=arc-20160816; b=XmV2n8qJuZQnfSplgXm9tlXl5P+6ricMpg2KoW/Km7u2M7oZJ/YTUlTqLjsft63dfC JgzAA+obgjrXp03l0Z4RmRW3kMeAiS6PLDVM8k4PWyuD6/k7vnBqP/tS28FkF/l6tsbN O5nS2W/IBDku15/Oh696IKx077hqgoQh+onNx2din2T6g9SBOt7yLuwvBHrCnSPmwgKM UY3XXxg0YHzuXkBOKzej4l7+mYOHT+8KiEm1offiRPRnyQUzI4i5PqzzefBsjJyS3YRG zyrYxxGR75MCf93oC242zfLapSsUM4lAXg9dPqFzUrWg+ftAkDGwdymPte+kv1qS3kmT Hz6A== 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=rmYbHL79wt4dhIbnCttbVVGP2ZT2H/KbCOCNp0UQlaM=; b=pvkvDilp00jgLDNhtVt7UOIvq8ekTX5BcmGZ71Ace/fLheQH59O7h51rVfTiO55/B0 vu8VHXmv7NW+bdDx+WI5qm5aMIyzBuXzXvPBUWBFbJ6v0cQvs2Of/a+DKqG3ccM71P5e hjutbn1/QIDxyiVIyq/vNzmYFIC/ANKjnCyU40d+XBt7Vo3I+EyX2jxL9h6tkEpsciNF UGOQtrdkyy11ed95rp7MLf6ZZLoTJ+OnsWaDA4ZxQeyWZM6BCGuZgr6kIbkQ1Lqu7WH1 3M8LL27y8VyIFPFTSRc+IlJSggl4Pw0iEwVEChwAnF+wGOIRqp8f/wsF0FaX5mw3g2MR J0dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=NnATg0XM; 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 n16si5094385ejr.507.2021.03.12.11.48.05; Fri, 12 Mar 2021 11:48:28 -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=NnATg0XM; 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 S234472AbhCLTrL (ORCPT + 99 others); Fri, 12 Mar 2021 14:47:11 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:22965 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234474AbhCLTqk (ORCPT ); Fri, 12 Mar 2021 14:46:40 -0500 Date: Fri, 12 Mar 2021 19:46:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1615578398; bh=rmYbHL79wt4dhIbnCttbVVGP2ZT2H/KbCOCNp0UQlaM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=NnATg0XMUItsW7CInI6e5paZ1QFL20P+ng7ZZFL/MNPwjsHBBW0hETFmUNezUKdjX 8KTwO3fS7w4pZpOGUXDTDi3G14R82yf0bXc0LNzsWViev3hjghwRW3ZMbLwRAhL540 78x8OJfu5bdmPFajVTxmQUXLC1yKnkNuIV7wotsfXfweJ4+JZH04YFE6IaaJFv52l+ mD0qm3liXPGkK3YDyS2FwEy8VQBfd3UVGJqMJbxedGb50nKLPhS8RIQgE3b+qxLJtO 2tMVA5oR713TE9sqZlVN/PQ0tY9+14Us5HnvPA9t4K2qU6NvUqimH5sd5sjVI0LMq+ Hs33ItmmEt5Eg== 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 net-next 2/6] skbuff: make __skb_header_pointer()'s data argument const Message-ID: <20210312194538.337504-3-alobakin@pm.me> In-Reply-To: <20210312194538.337504-1-alobakin@pm.me> References: <20210312194538.337504-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 0503c917d773..d93ab74063e5 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