From 4f7bfefe79f417a657dba5bd25129dd6961e8de7 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Thu, 22 Apr 2021 14:53:21 +0200 Subject: [PATCH] lib: move strsep() Allow the function to be individually linkable, discardable, and overridable. Signed-off-by: Jan Beulich Acked-by: Julien Grall --- xen/common/Makefile | 1 - xen/lib/Makefile | 1 + xen/{common/string.c => lib/strsep.c} | 8 +------- 3 files changed, 2 insertions(+), 8 deletions(-) rename xen/{common/string.c => lib/strsep.c} (83%) diff --git a/xen/common/Makefile b/xen/common/Makefile index e2a7e62d14..54de70d422 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -40,7 +40,6 @@ obj-y += softirq.o obj-y += smp.o obj-y += spinlock.o obj-y += stop_machine.o -obj-y += string.o obj-y += symbols.o obj-y += tasklet.o obj-y += time.o diff --git a/xen/lib/Makefile b/xen/lib/Makefile index dd96bd0d90..b311ea739c 100644 --- a/xen/lib/Makefile +++ b/xen/lib/Makefile @@ -25,6 +25,7 @@ lib-y += strncmp.o lib-y += strnlen.o lib-y += strpbrk.o lib-y += strrchr.o +lib-y += strsep.o lib-y += strspn.o lib-y += strstr.o lib-$(CONFIG_X86) += xxhash32.o diff --git a/xen/common/string.c b/xen/lib/strsep.c similarity index 83% rename from xen/common/string.c rename to xen/lib/strsep.c index 05cd199b61..0bda9901c2 100644 --- a/xen/common/string.c +++ b/xen/lib/strsep.c @@ -1,14 +1,9 @@ /* - * 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 @@ -20,7 +15,7 @@ * 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 *strsep(char **s, const char *ct) { char *sbegin = *s, *end; @@ -34,7 +29,6 @@ char * strsep(char **s, const char *ct) return sbegin; } -#endif /* * Local variables: -- 2.30.2