sysctl_check: drop table->procname checks
authorDenis Kirjanov <dkirjanov@kernel.org>
Wed, 23 Mar 2011 23:43:08 +0000 (16:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 02:46:50 +0000 (19:46 -0700)
Since the for loop checks for the table->procname drop useless
table->procname checks inside the loop body

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sysctl_check.c

index 10b90d8a03c48678258c6aaf3de353af7b06ed36..3a01c3e4649473547be45596dd6807351e5adb2c 100644 (file)
@@ -111,11 +111,9 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
                const char *fail = NULL;
 
                if (table->parent) {
-                       if (table->procname && !table->parent->procname)
+                       if (!table->parent->procname)
                                set_fail(&fail, table, "Parent without procname");
                }
-               if (!table->procname)
-                       set_fail(&fail, table, "No procname");
                if (table->child) {
                        if (table->data)
                                set_fail(&fail, table, "Directory with data?");
@@ -144,7 +142,7 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
                                        set_fail(&fail, table, "No maxlen");
                        }
 #ifdef CONFIG_PROC_SYSCTL
-                       if (table->procname && !table->proc_handler)
+                       if (!table->proc_handler)
                                set_fail(&fail, table, "No proc_handler");
 #endif
 #if 0