From nobody Mon Feb 9 09:33:54 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=1619015231; cv=none; d=zohomail.com; s=zohoarc; b=Obkp19bEGsxfmY+DPXvSaSugr0zgytymX7MK1Eh/ztg1ff8/j1gbFEGML37rNG9KyEgc+nwhsnN3vkwxLD9M988NEm+U4WMBuX3l0YoyQsqi+zel+Z1n6ctdty2gz5cH/ouewUj7jJReyAURvDf0habk4VGsyWjNjTWelsbYT08= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619015231; 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=u2H21liw5DO3IL1nQvzkhzYeKaGhal3AQ8PDJbmUMCo=; b=IwOEZYVeaa5+ge0yN9FdfYdLH5zNtgBdkdygTEoU9aBVTpBSAllkytK/CV7ctASOAb9zSn7JltPkVQXyerCyjn9OkP6jk69uAs4HjWVA0ijgaH2EQDghSmpkxXCWxKgZUVtuj+y0Im4DWeuknaVuL40nVJqDWlaulyaKybWP9M0= 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 1619015231221216.59565207584535; Wed, 21 Apr 2021 07:27:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.114715.218671 (Exim 4.92) (envelope-from ) id 1lZDod-0003n9-62; Wed, 21 Apr 2021 14:26:55 +0000 Received: by outflank-mailman (output) from mailman id 114715.218671; Wed, 21 Apr 2021 14:26:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZDod-0003n2-2k; Wed, 21 Apr 2021 14:26:55 +0000 Received: by outflank-mailman (input) for mailman id 114715; Wed, 21 Apr 2021 14:26:54 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lZDoc-0003mo-4P for xen-devel@lists.xenproject.org; Wed, 21 Apr 2021 14:26:54 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4eea3bb6-d7ab-44e6-845c-621b4b4e187c; Wed, 21 Apr 2021 14:26:53 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 408BDAF65; Wed, 21 Apr 2021 14:26:52 +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: 4eea3bb6-d7ab-44e6-845c-621b4b4e187c 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=1619015212; 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=u2H21liw5DO3IL1nQvzkhzYeKaGhal3AQ8PDJbmUMCo=; b=XqP2dv9mov/1KCzTSo1Vao8a0tPp7NgMQrVDUIvJR5jYig9xHAd2ROdke6ZI9n/T1Tauu2 ZnYLhA4Rf7N6krTfb7dFrXfNLyZOGQZdauKb5YxjH3iSuVMDzFOzjs8G5t4edx15tudKEy QZYEjB4sMA3miMyLa5I7PJgn59OaJwc= Subject: [PATCH v2 20/20] lib: move strsep() 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: Date: Wed, 21 Apr 2021 16:26:51 +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. Signed-off-by: Jan Beulich --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -40,7 +40,6 @@ obj-y +=3D softirq.o obj-y +=3D smp.o obj-y +=3D spinlock.o obj-y +=3D stop_machine.o -obj-y +=3D string.o obj-y +=3D symbols.o obj-y +=3D tasklet.o obj-y +=3D time.o --- a/xen/common/string.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * linux/lib/string.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -#include -#include -#include - -#ifndef __HAVE_ARCH_STRSEP -/** - * strsep - Split a string into tokens - * @s: The string to be searched - * @ct: The characters to search for - * - * strsep() updates @s to point after the token, ready for the next call. - * - * It returns empty tokens, too, behaving exactly like the libc function - * of that name. In fact, it was stolen from glibc2 and de-fancy-fied. - * Same semantics, slimmer shape. ;) - */ -char * strsep(char **s, const char *ct) -{ - char *sbegin =3D *s, *end; - - if (sbegin =3D=3D NULL) - return NULL; - - end =3D strpbrk(sbegin, ct); - if (end) - *end++ =3D '\0'; - *s =3D end; - - return sbegin; -} -#endif - -/* - * Local variables: - * mode: C - * c-file-style: "BSD" - * c-basic-offset: 8 - * tab-width: 8 - * indent-tabs-mode: t - * End: - */ --- a/xen/lib/Makefile +++ b/xen/lib/Makefile @@ -25,6 +25,7 @@ lib-y +=3D strncmp.o lib-y +=3D strnlen.o lib-y +=3D strpbrk.o lib-y +=3D strrchr.o +lib-y +=3D strsep.o lib-y +=3D strspn.o lib-y +=3D strstr.o lib-$(CONFIG_X86) +=3D xxhash32.o --- /dev/null +++ b/xen/lib/strsep.c @@ -0,0 +1,41 @@ +/* + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +#include + +/** + * strsep - Split a string into tokens + * @s: The string to be searched + * @ct: The characters to search for + * + * strsep() updates @s to point after the token, ready for the next call. + * + * It returns empty tokens, too, behaving exactly like the libc function + * of that name. In fact, it was stolen from glibc2 and de-fancy-fied. + * Same semantics, slimmer shape. ;) + */ +char *strsep(char **s, const char *ct) +{ + char *sbegin =3D *s, *end; + + if (sbegin =3D=3D NULL) + return NULL; + + end =3D strpbrk(sbegin, ct); + if (end) + *end++ =3D '\0'; + *s =3D end; + + return sbegin; +} + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 8 + * tab-width: 8 + * indent-tabs-mode: t + * End: + */