Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382Ab1FBQA4 (ORCPT ); Thu, 2 Jun 2011 12:00:56 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:55153 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752817Ab1FBQAz (ORCPT ); Thu, 2 Jun 2011 12:00:55 -0400 From: Lucas De Marchi To: "Eric W. Biederman" Cc: Jesper Juhl , linux-kernel@vger.kernel.org, Nick Piggin , Christoph Hellwig , Al Viro , Lucas De Marchi Subject: [PATCH] sysctl: remove impossible condition check Date: Thu, 2 Jun 2011 13:00:44 -0300 Message-Id: <1307030444-7095-1-git-send-email-lucas.demarchi@profusion.mobi> X-Mailer: git-send-email 1.7.5.2 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1293 Lines: 48 Signed-off-by: Lucas De Marchi --- fs/proc/proc_sysctl.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index f50133c..6cbcb1e 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -49,17 +49,11 @@ out: static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name) { - int len; for ( ; p->procname; p++) { - - if (!p->procname) - continue; - - len = strlen(p->procname); - if (len != name->len) + if (strlen(p->procname) != name->len) continue; - if (memcmp(p->procname, name->name, len) != 0) + if (memcmp(p->procname, name->name, name->len) != 0) continue; /* I have a match */ @@ -223,10 +217,6 @@ static int scan(struct ctl_table_header *head, ctl_table *table, for (; table->procname; table++, (*pos)++) { int res; - /* Can't do anything without a proc name */ - if (!table->procname) - continue; - if (*pos < file->f_pos) continue; -- 1.7.5.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/