Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp16781rdb; Mon, 4 Dec 2023 18:25:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHz8Y/B8liXMqJ6RIv5L9y9RJadroJouc2bhyVNE7RWSSIEej7YrOcRwDgTK4j9Xldx4YYC X-Received: by 2002:a17:902:f80f:b0:1d0:488e:3827 with SMTP id ix15-20020a170902f80f00b001d0488e3827mr6561779plb.56.1701743145754; Mon, 04 Dec 2023 18:25:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701743145; cv=none; d=google.com; s=arc-20160816; b=gKcSryh4onf3lg2/eEJvn7lTJNTQ27gZ0b1VA4J3eD6tiNn4zcpV9WJfUZgAL0wLpw oUM/R2hmUobBRB3Heje8S0OlPMUWjPu0LDVX5+X9E4KvRuHRBHBujOjp+8QvuMte8sJB u5QNUlWbyiDQDYKESVM/LHTZkDuxQnhFkJZvPhj8dt+GyQKJUkLkkmfmp1qtC6UsRyZr 2cLZ4oOLFvvNlTMvOMp6CsLt2IFqnJlP+NKCeoSjC0tRprOSGwze8jtO3qyeHTIqrN7k /WTSETexqStuFw1DOqAtpSfcUtTj7Yk4SZZxZ1zk4nTpxJ+eXBdYEMb+1e5ApvCph2oo WrJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zPz4rykQwfacSAH0nWWTI708Z+TOJIpHH4duT4lMs50=; fh=DgGXwGbnyiv1Rvt/NkXbEKOXDvWVLBCb4IpCdacEJoI=; b=IhKtI6Cfb8eExLjHJwhwlkT4YhcPHFHgDlpgQzcTYdrftvkiNmXUd85YKLFShMAiQ1 GHuGrcpIkStLlYdnRCjzRrw8V38DxlEg4GezKsBETJQMsSIzDJAWDQVEFmZgsrrVhsUp nm9th0Y0fw4cppPrMzdSMnfLF0QYPUFsWJ5p3pGx4Q5hTGXpkej0B5OdcbwhQSov6hek Hbpi0SPbdcoUfSgqkVP/JCA1DKHok8DeT9f5WdyoqclDdAc+RB81Cc20azT0noGd7S/5 os88p7u4Q26MfwFAEqjx5Ylv1QmRtxY8ATTFcUgJVoqet6ATdCQe0ubkeo9wxhfdOKhK POMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=Yc6pmTWC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 6-20020a170902c24600b001d09b006bc8si2833480plg.87.2023.12.04.18.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 18:25:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=Yc6pmTWC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 51D3680898C3; Mon, 4 Dec 2023 18:25:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376336AbjLECYo (ORCPT + 99 others); Mon, 4 Dec 2023 21:24:44 -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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 04 Dec 2023 18:25:31 -0800 (PST) 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