staging: dgap: remove unused code
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Sat, 9 May 2015 12:29:42 +0000 (17:59 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 13:17:50 +0000 (15:17 +0200)
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>
drivers/staging/dgap/dgap.c

index ea833fc..92ae8da 100644 (file)
@@ -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;