Whamcloud - gitweb
LU-6142 libcfs: discard cfs_strrstr()
[fs/lustre-release.git] / libcfs / libcfs / libcfs_string.c
index 1ba1c24..40f7aaf 100644 (file)
 #include <libcfs/libcfs.h>
 #include <libcfs/libcfs_string.h>
 
-char *cfs_strrstr(const char *haystack, const char *needle)
-{
-       char *ptr;
-
-       if (unlikely(haystack == NULL || needle == NULL))
-               return NULL;
-
-       if (strlen(needle) == 1)
-               return strrchr(haystack, needle[0]);
-
-       ptr = strstr(haystack, needle);
-       if (ptr != NULL) {
-               while (1) {
-                       char *tmp;
-
-                       tmp = strstr(&ptr[1], needle);
-                       if (tmp == NULL)
-                               return ptr;
-
-                       ptr = tmp;
-               }
-       }
-
-       return NULL;
-}
-EXPORT_SYMBOL(cfs_strrstr);
-
 /* Convert a text string to a bitmask */
 int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
                 int *oldmask, int minmask, int allmask)