diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-05-09 17:59:42 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-05-10 15:17:50 +0200 |
commit | 56f40e521047ae8623ad5dcbb5a08ad91684cab6 (patch) | |
tree | 7d56da8e68ecffeb9e8a1a0b49cf8129d4198eac /drivers/staging/dgap | |
parent | 1397e2fd065a87f623263e23028f3b252917121b (diff) | |
download | lwn-56f40e521047ae8623ad5dcbb5a08ad91684cab6.tar.gz lwn-56f40e521047ae8623ad5dcbb5a08ad91684cab6.zip |
staging: dgap: remove unused code
dgap_sindex() is being only called from dgap_getword() which searches
for either ' ' or '\t' or '\n'. this part of the code with '^' at the
beginning is never used.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r-- | drivers/staging/dgap/dgap.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index ea833fc6addb..92ae8da9b7a3 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -290,8 +290,7 @@ static struct toklist dgap_tlist[] = { /* * dgap_sindex: much like index(), but it looks for a match of any character in - * the group, and returns that position. If the first character is a ^, then - * this will match the first occurrence not in that group. + * the group, and returns that position. */ static char *dgap_sindex(char *string, char *group) { @@ -300,23 +299,11 @@ static char *dgap_sindex(char *string, char *group) if (!string || !group) return NULL; - if (*group == '^') { - group++; - for (; *string; string++) { - for (ptr = group; *ptr; ptr++) { - if (*ptr == *string) - break; - } - if (*ptr == '\0') + for (; *string; string++) { + for (ptr = group; *ptr; ptr++) { + if (*ptr == *string) return string; } - } else { - for (; *string; string++) { - for (ptr = group; *ptr; ptr++) { - if (*ptr == *string) - return string; - } - } } return NULL; |