s390: simplify one-level syctl registration for s390dbf_table
authorLuis Chamberlain <mcgrof@kernel.org>
Fri, 10 Mar 2023 23:45:21 +0000 (15:45 -0800)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 20 Mar 2023 09:56:48 +0000 (10:56 +0100)
There is no need to declare an extra tables to just create directory,
this can be easily be done with a prefix path with register_sysctl().

Simplify this registration.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20230310234525.3986352-3-mcgrof@kernel.org
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/kernel/debug.c

index b376f03..221c865 100644 (file)
@@ -981,16 +981,6 @@ static struct ctl_table s390dbf_table[] = {
        { }
 };
 
-static struct ctl_table s390dbf_dir_table[] = {
-       {
-               .procname       = "s390dbf",
-               .maxlen         = 0,
-               .mode           = S_IRUGO | S_IXUGO,
-               .child          = s390dbf_table,
-       },
-       { }
-};
-
 static struct ctl_table_header *s390dbf_sysctl_header;
 
 /**
@@ -1574,7 +1564,7 @@ out:
  */
 static int __init debug_init(void)
 {
-       s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
+       s390dbf_sysctl_header = register_sysctl("s390dbf", s390dbf_table);
        mutex_lock(&debug_mutex);
        debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT, NULL);
        initialized = 1;