From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Authentication-Results: gnuweeb.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=LdazeWMB; dkim-atps=neutral Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=srs0=mts8=f2=paulmck-thinkpad-p17-gen-1.home=paulmck@kernel.org; receiver= Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gnuweeb.org (Postfix) with ESMTPS id 8F01D2493DC for ; Fri, 13 Oct 2023 02:32:40 +0700 (WIB) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 054F7B826EC; Thu, 12 Oct 2023 19:32:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BBC9C43395; Thu, 12 Oct 2023 19:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697139156; bh=pphMddfrgHcoIgmzZWe7AThL9XYOSaOTFelQzzfUfsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LdazeWMBWcAQZfED1qwdpEIQorVe9/eBbjPS3DMhBBM8Z4UUpdQWPEmRT8xIvv9KL w/15YUSQAie+QUB/Gw/qy2T201551+DDjkBrERGlhlne3I4PT6MlyVT/qtt3MxxZGp XbRp4NVSUeaMvtME8tuDbxSSuGvKCiBH87ooFlHmA59mJOVb/dnOKAEoPS91Y3g5Cw lr8OkHjfjnUxN76mJxKB/uXXSIAGnq8PFCS2SjB0zqAc/3xFY26BEsJD13a7htGCeb mOAWrzKaQER7m4T3SdT/y+DneSMgNFLSNo6awgO2/I/7vdYPbP2QqW8bJ11ShXWTqe 4WQ48jTxsUm3w== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 51D99CE0C3B; Thu, 12 Oct 2023 12:32:35 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: gwml@vger.gnuweeb.org, kernel-team@meta.com, w@lwt.eu, Ammar Faizi , Alviro Iskandar Setiawan , Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Subject: [PATCH nolibc 09/19] tools/nolibc: string: Remove the `_nolibc_memcpy_up()` function Date: Thu, 12 Oct 2023 12:32:23 -0700 Message-Id: <20231012193233.207857-9-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: From: Ammar Faizi This function is only called by memcpy(), there is no real reason to have this wrapper. Delete this function and move the code to memcpy() directly. Signed-off-by: Ammar Faizi Reviewed-by: Alviro Iskandar Setiawan Signed-off-by: Willy Tarreau Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/string.h | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h index 22dcb3f566ba..a01c69dd495f 100644 --- a/tools/include/nolibc/string.h +++ b/tools/include/nolibc/string.h @@ -27,18 +27,6 @@ int memcmp(const void *s1, const void *s2, size_t n) return c1; } -static __attribute__((unused)) -void *_nolibc_memcpy_up(void *dst, const void *src, size_t len) -{ - size_t pos = 0; - - while (pos < len) { - ((char *)dst)[pos] = ((const char *)src)[pos]; - pos++; - } - return dst; -} - #ifndef NOLIBC_ARCH_HAS_MEMMOVE /* might be ignored by the compiler without -ffreestanding, then found as * missing. @@ -70,7 +58,13 @@ void *memmove(void *dst, const void *src, size_t len) __attribute__((weak,unused,section(".text.nolibc_memcpy"))) void *memcpy(void *dst, const void *src, size_t len) { - return _nolibc_memcpy_up(dst, src, len); + size_t pos = 0; + + while (pos < len) { + ((char *)dst)[pos] = ((const char *)src)[pos]; + pos++; + } + return dst; } #endif /* #ifndef NOLIBC_ARCH_HAS_MEMCPY */ -- 2.40.1