sunrpc: simplify one-level sysctl registration for xr_tunables_table
authorLuis Chamberlain <mcgrof@kernel.org>
Sat, 11 Mar 2023 23:39:41 +0000 (15:39 -0800)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 11 Apr 2023 16:44:49 +0000 (12:44 -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/xprtrdma/transport.c

index 10bb2b929c6d70749b10d12d54824275add1aaa4..29b0562d62e759e11ec8ede44c2a1e715d6d5509 100644 (file)
@@ -140,15 +140,6 @@ static struct ctl_table xr_tunables_table[] = {
        { },
 };
 
-static struct ctl_table sunrpc_table[] = {
-       {
-               .procname       = "sunrpc",
-               .mode           = 0555,
-               .child          = xr_tunables_table
-       },
-       { },
-};
-
 #endif
 
 static const struct rpc_xprt_ops xprt_rdma_procs;
@@ -799,7 +790,7 @@ int xprt_rdma_init(void)
 
 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
        if (!sunrpc_table_header)
-               sunrpc_table_header = register_sysctl_table(sunrpc_table);
+               sunrpc_table_header = register_sysctl("sunrpc", xr_tunables_table);
 #endif
        return 0;
 }