From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03048C4167B for ; Tue, 5 Dec 2023 02:24:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344067AbjLECYq (ORCPT ); Mon, 4 Dec 2023 21:24:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344042AbjLECYU (ORCPT ); Mon, 4 Dec 2023 21:24:20 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92969107; Mon, 4 Dec 2023 18:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=zPz4rykQwfacSAH0nWWTI708Z+TOJIpHH4duT4lMs50=; b=Yc6pmTWCRD6AXJXwlDC4RrIjDd OAFvLPG7P4UixmW2hIGf8ZKzKmRc33Tubhyau4vqxs78fLRW1r76fnXtPXd5EXKzwixXvTUv8LAS3 P0Aw7l8dx4CPQHRlG+dKRPtGgOPAhZerdEkAbXdqynqaXAPStPkEyHF0H17BcEZ1msXdgHb8f0aY3 33PuR6yUh7TNjRnpxYJXvGM7d2SqqjCjCL6Z8qpeYdlTkmI3/pkCkxuCOMVP7KpT5ECgJlBRL8xLq Y00NYi43jZY/Hm35zpoBgh7Q/Tg1XJoaMyW7a771W/ZSFBmjrsqQLkZzyWfn1YTBnZlkbIotHyHxB Qw9dIIZA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rAL6l-007941-1k; Tue, 05 Dec 2023 02:24:23 +0000 From: Al Viro To: linux-arch@vger.kernel.org Cc: gus Gusenleitner Klaus , Al Viro , Thomas Gleixner , lkml , Ingo Molnar , "bp@alien8.de" , "dave.hansen@linux.intel.com" , "x86@kernel.org" , "David S. Miller" , "dsahern@kernel.org" , "kuba@kernel.org" , Paolo Abeni , Eric Dumazet Subject: [PATCH v2 16/18] x86: lift the extern for csum_partial() into checksum.h Date: Tue, 5 Dec 2023 02:24:16 +0000 Message-Id: <20231205022418.1703007-25-viro@zeniv.linux.org.uk> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231205022418.1703007-1-viro@zeniv.linux.org.uk> References: <20231205022100.GB1674809@ZenIV> <20231205022418.1703007-1-viro@zeniv.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Al Viro --- arch/x86/include/asm/checksum.h | 12 ++++++++++++ arch/x86/include/asm/checksum_32.h | 14 -------------- arch/x86/include/asm/checksum_64.h | 12 ------------ 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/arch/x86/include/asm/checksum.h b/arch/x86/include/asm/checksum.h index 5c0a730c7316..05dd4c59880a 100644 --- a/arch/x86/include/asm/checksum.h +++ b/arch/x86/include/asm/checksum.h @@ -26,6 +26,18 @@ static inline __wsum csum_add(__wsum csum, __wsum addend) # define HAVE_CSUM_COPY_USER # define _HAVE_ARCH_CSUM_AND_COPY +/** + * csum_partial - Compute an internet checksum. + * @buff: buffer to be checksummed + * @len: length of buffer. + * @sum: initial sum to be added in (32bit unfolded) + * + * Returns the 32bit unfolded internet checksum of the buffer. + * Before filling it in it needs to be csum_fold()'ed. + * buff should be aligned to a word boundary if possible. + */ +extern asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); + /** * csum_fold - Fold and invert a 32bit checksum. * sum: 32bit unfolded sum diff --git a/arch/x86/include/asm/checksum_32.h b/arch/x86/include/asm/checksum_32.h index 959f8c6f5247..164bf98fb23a 100644 --- a/arch/x86/include/asm/checksum_32.h +++ b/arch/x86/include/asm/checksum_32.h @@ -5,20 +5,6 @@ #include #include -/* - * computes the checksum of a memory block at buff, length len, - * and adds in "sum" (32-bit) - * - * returns a 32-bit number suitable for feeding into itself - * or csum_tcpudp_magic - * - * this function must be called with even lengths, except - * for the last fragment, which may be odd - * - * it's best to have buff aligned on a 32-bit boundary - */ -asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum); - /* * the same as csum_partial, but copies from src while it * checksums, and handles user-space pointer exceptions correctly, when needed. diff --git a/arch/x86/include/asm/checksum_64.h b/arch/x86/include/asm/checksum_64.h index c86db605c0fd..ce28f7c0bc29 100644 --- a/arch/x86/include/asm/checksum_64.h +++ b/arch/x86/include/asm/checksum_64.h @@ -11,18 +11,6 @@ #include #include -/** - * csum_partial - Compute an internet checksum. - * @buff: buffer to be checksummed - * @len: length of buffer. - * @sum: initial sum to be added in (32bit unfolded) - * - * Returns the 32bit unfolded internet checksum of the buffer. - * Before filling it in it needs to be csum_fold()'ed. - * buff should be aligned to a 64bit boundary if possible. - */ -extern __wsum csum_partial(const void *buff, int len, __wsum sum); - /* Do not call this directly. Use the wrappers below */ extern __visible __wsum_fault csum_partial_copy_generic(const void *src, void *dst, int len); -- 2.39.2