Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756176Ab1EHWwK (ORCPT ); Sun, 8 May 2011 18:52:10 -0400 Received: from mail-ww0-f44.google.com ([74.125.82.44]:40833 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932527Ab1EHWll (ORCPT ); Sun, 8 May 2011 18:41:41 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=wv+EtkrIognQoxlEQwsHTo4E/DkjzVBXkjyCaHkn9VjYi0/e94GoB8x6h1+Tm/bWV3 X+f+oDtT7QNSkIdVRUm8ZoxMuLYkrUfgaknfJ1GsWSdi3PIc3vU7OvOBJV5TcWJpZrmM KwKDkD2Kmh69zhNBcQWzXOU166pWbzaavsf0g= From: Lucian Adrian Grijincu To: linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, Lucian Adrian Grijincu Subject: [v2 063/115] sysctl: simplify find_in_table Date: Mon, 9 May 2011 00:39:15 +0200 Message-Id: <1304894407-32201-64-git-send-email-lucian.grijincu@gmail.com> X-Mailer: git-send-email 1.7.5.134.g1c08b In-Reply-To: <1304894407-32201-1-git-send-email-lucian.grijincu@gmail.com> References: <1304894407-32201-1-git-send-email-lucian.grijincu@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1108 Lines: 41 The if (!p->procname) check is useless because the loop condition prevents it from happening. Signed-off-by: Lucian Adrian Grijincu --- fs/proc/proc_sysctl.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index f50133c..d1640bc 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -52,18 +52,12 @@ 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) continue; - if (memcmp(p->procname, name->name, len) != 0) - continue; - - /* I have a match */ - return p; + if (memcmp(p->procname, name->name, len) == 0) + return p; } return NULL; } -- 1.7.5.134.g1c08b -- 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/