summaryrefslogtreecommitdiff
path: root/drivers/staging/dgap
diff options
context:
space:
mode:
authorAlexander Kuleshov <kuleshovmail@gmail.com>2015-09-12 00:22:15 +0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-12 18:24:57 -0700
commitb9f7f1d0846f15585b8af64435b6b706b25a5c0b (patch)
tree0290636d4de29fc4c2f58713270a9cc2a625730b /drivers/staging/dgap
parent7e25075e3e34cedf660c63e30bfcc7e385d40766 (diff)
staging/dgap: Use strpbrk() instead of dgap_sindex()
The <linux/string.h> provides strpbrk() function that does the same that the dgap_sindex(). Let's use already defined function instead of writing custom. Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r--drivers/staging/dgap/dgap.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index ee37938ea886..303d97023ccb 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -287,28 +287,6 @@ static struct toklist dgap_tlist[] = {
{ 0, NULL }
};
-
-/*
- * dgap_sindex: much like index(), but it looks for a match of any character in
- * the group, and returns that position.
- */
-static char *dgap_sindex(char *string, char *group)
-{
- char *ptr;
-
- if (!string || !group)
- return NULL;
-
- for (; *string; string++) {
- for (ptr = group; *ptr; ptr++) {
- if (*ptr == *string)
- return string;
- }
- }
-
- return NULL;
-}
-
/*
* get a word from the input stream, also keep track of current line number.
* words are separated by whitespace.
@@ -317,7 +295,7 @@ static char *dgap_getword(char **in)
{
char *ret_ptr = *in;
- char *ptr = dgap_sindex(*in, " \t\n");
+ char *ptr = strpbrk(*in, " \t\n");
/* If no word found, return null */
if (!ptr)