From nobody Mon Feb 9 06:29:00 2026 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 8AD0BCA0FFC for ; Sat, 2 Sep 2023 05:51:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351601AbjIBFvY (ORCPT ); Sat, 2 Sep 2023 01:51:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351593AbjIBFvV (ORCPT ); Sat, 2 Sep 2023 01:51:21 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E2AD1703 for ; Fri, 1 Sep 2023 22:51:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1693633876; bh=wAfHXdyA6GZWEdNku2JSukYgPjxVsfGqEuLvT3ts0Qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=In2+PoLeMiRv9KKUXN3cUjeymX4Gtga8saNBekvRy+tDOPY6Nu0BHTvd+ASgZYvK9 Z1O+yWWzkK1vemeW5QqhjWkZgAvZdOvX7R1ohVix4elg1ZSmh+wdGBEcoiVV+XD3pq r7pqW+Q2wfIAoLVo4gU7OnHAikkaJflg7niFDWlLWoeZiJTcZHr1Uxtnm8zS9EpVEY gVm4jyxSmhpqVAPgdTSYZjt9IaMHqQ6qf36V44tMcYjR4/+sKVY6wEVlWytDEqilI7 M0S8k0pAiyu8jnoW6zQuddDcttOg22kiIDaOrig5tLVu7a+OTg6cdGiEihghlcm1fR cCpWQacNqSiLw== Received: from localhost.localdomain (unknown [182.253.126.208]) by gnuweeb.org (Postfix) with ESMTPSA id 2253124B3AD; Sat, 2 Sep 2023 12:51:12 +0700 (WIB) From: Ammar Faizi To: Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Cc: Ammar Faizi , David Laight , Nicholas Rosenberg , Alviro Iskandar Setiawan , Michael William Jonathan , GNU/Weeb Mailing List , Linux Kernel Mailing List Subject: [RFC PATCH v2 3/4] tools/nolibc: string: Remove the `_nolibc_memcpy_down()` function Date: Sat, 2 Sep 2023 12:50:44 +0700 Message-Id: <20230902055045.2138405-4-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230902055045.2138405-1-ammarfaizi2@gnuweeb.org> References: <20230902055045.2138405-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This nolibc internal function is not used. Delete it. It was probably supposed to handle memmove(), but today the memmove() has its own implementation. Signed-off-by: Ammar Faizi --- tools/include/nolibc/string.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h index 1bad6121ef8c4ab5..22dcb3f566baeefe 100644 --- a/tools/include/nolibc/string.h +++ b/tools/include/nolibc/string.h @@ -22,50 +22,40 @@ int memcmp(const void *s1, const void *s2, size_t n) int c1 =3D 0; =20 while (ofs < n && !(c1 =3D ((unsigned char *)s1)[ofs] - ((unsigned char *= )s2)[ofs])) { ofs++; } return c1; } =20 static __attribute__((unused)) void *_nolibc_memcpy_up(void *dst, const void *src, size_t len) { size_t pos =3D 0; =20 while (pos < len) { ((char *)dst)[pos] =3D ((const char *)src)[pos]; pos++; } return dst; } =20 -static __attribute__((unused)) -void *_nolibc_memcpy_down(void *dst, const void *src, size_t len) -{ - while (len) { - len--; - ((char *)dst)[len] =3D ((const char *)src)[len]; - } - return dst; -} - #ifndef NOLIBC_ARCH_HAS_MEMMOVE /* might be ignored by the compiler without -ffreestanding, then found as * missing. */ __attribute__((weak,unused,section(".text.nolibc_memmove"))) void *memmove(void *dst, const void *src, size_t len) { size_t dir, pos; =20 pos =3D len; dir =3D -1; =20 if (dst < src) { pos =3D -1; dir =3D 1; } =20 while (len) { pos +=3D dir; ((char *)dst)[pos] =3D ((const char *)src)[pos]; --=20 Ammar Faizi