sunrpc: simplify one-level sysctl registration for debug_table
authorLuis Chamberlain <mcgrof@kernel.org>
Sat, 11 Mar 2023 23:39:44 +0000 (15:39 -0800)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 11 Apr 2023 16:45:19 +0000 (12:45 -0400)
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>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/sysctl.c

index afdfcc5..93941ab 100644 (file)
@@ -163,20 +163,11 @@ static struct ctl_table debug_table[] = {
        { }
 };
 
-static struct ctl_table sunrpc_table[] = {
-       {
-               .procname       = "sunrpc",
-               .mode           = 0555,
-               .child          = debug_table
-       },
-       { }
-};
-
 void
 rpc_register_sysctl(void)
 {
        if (!sunrpc_table_header)
-               sunrpc_table_header = register_sysctl_table(sunrpc_table);
+               sunrpc_table_header = register_sysctl("sunrpc", debug_table);
 }
 
 void