From nobody Mon Feb 9 17:37:01 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1619015185; cv=none; d=zohomail.com; s=zohoarc; b=Xz9w1AYJims1aFtUrpvV0MAKuNs6leaft//gvmqJXYcdffYrnD9raEv7LXF3CrfPVSAzOCQwmWW/A+zo4V1N/BOkRC4iZsh/Ewf5pEEzswvbwvEeAxxrdD/TYGahOgx2R6TDx/UdIpXqmJUFVLLwJnm3DFRfAsdfz2+A2JtVvoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619015185; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/ikAXGR+d4BQ68yH7iPulr9qDYJtJu1Q/hYMFGUEDmQ=; b=IwN4lSzqIpyLDNVrVuwD9kayv1sx+gnAi3kUS1NJYilnD1O4SHMG/HqODeSytUnt3a4JtqXjUfk+0EdnETKQM4AZWfzeKR6LKer5BQmqgkFzXuxyBnNli8jyTwTQDDb3EFQhN/FULb2Wsx7g9EjrpLdlLx2uyhV9LLz9w0ruERw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1619015185607627.7816702310887; Wed, 21 Apr 2021 07:26:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.114706.218647 (Exim 4.92) (envelope-from ) id 1lZDnv-0003ZE-MM; Wed, 21 Apr 2021 14:26:11 +0000 Received: by outflank-mailman (output) from mailman id 114706.218647; Wed, 21 Apr 2021 14:26:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZDnv-0003Z7-H2; Wed, 21 Apr 2021 14:26:11 +0000 Received: by outflank-mailman (input) for mailman id 114706; Wed, 21 Apr 2021 14:26:10 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZDnu-0003Ys-Cn for xen-devel@lists.xenproject.org; Wed, 21 Apr 2021 14:26:10 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 888cad03-6053-4b2d-acb0-378bef7832e2; Wed, 21 Apr 2021 14:26:09 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BFD2CB4D3; Wed, 21 Apr 2021 14:26:08 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 888cad03-6053-4b2d-acb0-378bef7832e2 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1619015168; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/ikAXGR+d4BQ68yH7iPulr9qDYJtJu1Q/hYMFGUEDmQ=; b=h9YVw9owsJSwRLAOuwbARKv1fN5XXz07GXtO75c3x9FV8uOXtHa/5VNdPPxxFkhPVq+O0A fQCN26olM7rWvOnEjNa1c1B3kYlRgfb4CfylivRzVjGUQxL3papNGHOGXqoYgWT6/r1PZF 7nlyFKtoXqFUtN/K8JZn8Dwm0hl3+0k= Subject: [PATCH v2 18/20] lib: move strspn() From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , George Dunlap , Ian Jackson , Julien Grall , Stefano Stabellini , Wei Liu References: <3ae091ce-6f6c-3ec6-abd3-4490239a707f@suse.com> Message-ID: <901b2b75-c042-febf-b0cf-a6e7f806b26a@suse.com> Date: Wed, 21 Apr 2021 16:26:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <3ae091ce-6f6c-3ec6-abd3-4490239a707f@suse.com> Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) Content-Type: text/plain; charset="utf-8" Allow the function to be individually linkable, discardable, and overridable. In fact the function is unused at present, and hence will now get omitted from the final binaries. Signed-off-by: Jan Beulich --- a/xen/common/string.c +++ b/xen/common/string.c @@ -8,33 +8,6 @@ #include #include =20 -#ifndef __HAVE_ARCH_STRSPN -/** - * strspn - Calculate the length of the initial substring of @s which only - * contain letters in @accept - * @s: The string to be searched - * @accept: The string to search for - */ -size_t strspn(const char *s, const char *accept) -{ - const char *p; - const char *a; - size_t count =3D 0; - - for (p =3D s; *p !=3D '\0'; ++p) { - for (a =3D accept; *a !=3D '\0'; ++a) { - if (*p =3D=3D *a) - break; - } - if (*a =3D=3D '\0') - return count; - ++count; - } - - return count; -} -#endif - #ifndef __HAVE_ARCH_STRPBRK /** * strpbrk - Find the first occurrence of a set of characters --- a/xen/lib/Makefile +++ b/xen/lib/Makefile @@ -24,6 +24,7 @@ lib-y +=3D strncasecmp.o lib-y +=3D strncmp.o lib-y +=3D strnlen.o lib-y +=3D strrchr.o +lib-y +=3D strspn.o lib-y +=3D strstr.o lib-$(CONFIG_X86) +=3D xxhash32.o lib-$(CONFIG_X86) +=3D xxhash64.o --- /dev/null +++ b/xen/lib/strspn.c @@ -0,0 +1,40 @@ +/* + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#include + +/** + * strspn - Calculate the length of the initial substring of @s which only + * contain letters in @accept + * @s: The string to be searched + * @accept: The string to search for + */ +size_t strspn(const char *s, const char *accept) +{ + const char *p; + const char *a; + size_t count =3D 0; + + for (p =3D s; *p !=3D '\0'; ++p) { + for (a =3D accept; *a !=3D '\0'; ++a) { + if (*p =3D=3D *a) + break; + } + if (*a =3D=3D '\0') + return count; + ++count; + } + + return count; +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + */