From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751460AbbEIM3z (ORCPT ); Sat, 9 May 2015 08:29:55 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36540 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbbEIM3x (ORCPT ); Sat, 9 May 2015 08:29:53 -0400 From: Sudip Mukherjee To: Lidza Louina , Mark Hounschell , Daeseok Youn , Greg Kroah-Hartman Cc: driverdev-devel@linuxdriverproject.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Sudip Mukherjee Subject: [PATCH] staging: dgap: remove unused code Date: Sat, 9 May 2015 17:59:42 +0530 Message-Id: <1431174582-9461-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/staging/dgap/dgap.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index 6766d5a..6b983bc 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; -- 1.8.1.2