[lustre-devel] [PATCH 36/41] lnet: libcfs: discard cfs_firststr

James Simmons jsimmons at infradead.org
Mon Apr 5 00:51:05 PST 2021


From: Mr NeilBrown <neilb at suse.de>

The effect of cfs_firststr() can easily achieved with
skip_space() and strsep().

So use that instead.

WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lustre-commit: ee5eb07d2f41ac60 ("LU-6142 libcfs: discard cfs_firststr")
Signed-off-by: Mr NeilBrown <neilb at suse.de>
Reviewed-on: https://review.whamcloud.com/40860
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: James Simmons <jsimmons at infradead.org>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 net/lnet/libcfs/libcfs_string.c | 28 ----------------------------
 1 file changed, 28 deletions(-)

diff --git a/net/lnet/libcfs/libcfs_string.c b/net/lnet/libcfs/libcfs_string.c
index b042de5..66a108c 100644
--- a/net/lnet/libcfs/libcfs_string.c
+++ b/net/lnet/libcfs/libcfs_string.c
@@ -115,34 +115,6 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
 	return 0;
 }
 
-/* get the first string out of @str */
-char *cfs_firststr(char *str, size_t size)
-{
-	size_t i = 0;
-	char *end;
-
-	/* trim leading spaces */
-	while (i < size && *str && isspace(*str)) {
-		++i;
-		++str;
-	}
-
-	/* string with all spaces */
-	if (*str == '\0')
-		goto out;
-
-	end = str;
-	while (i < size && *end != '\0' && !isspace(*end)) {
-		++i;
-		++end;
-	}
-
-	*end = '\0';
-out:
-	return str;
-}
-EXPORT_SYMBOL(cfs_firststr);
-
 /**
  * Extracts tokens from strings.
  *
-- 
1.8.3.1



More information about the lustre-devel mailing list