All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: chuck.lever@oracle.com, jlayton@kernel.org,
	trond.myklebust@hammerspace.com, anna@kernel.org,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	kuba@kernel.org, linux-nfs@vger.kernel.org
Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com,
	j.granados@samsung.com, patches@lists.linux.dev,
	linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH v3 4/5] sunrpc: move sunrpc_table and proc routines above
Date: Sat, 11 Mar 2023 15:39:43 -0800	[thread overview]
Message-ID: <20230311233944.354858-5-mcgrof@kernel.org> (raw)
In-Reply-To: <20230311233944.354858-1-mcgrof@kernel.org>

No need to do a forward declaration for sunrpc_table, just move
the sysctls up as everyone else does it. This will make the next
change easier to read. This change produces no functional changes.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
 net/sunrpc/sysctl.c | 35 ++++++++++++++++-------------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 3aad6ef18504..afdfcc5403af 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -40,25 +40,6 @@ EXPORT_SYMBOL_GPL(nlm_debug);
 
 #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
 
-static struct ctl_table_header *sunrpc_table_header;
-static struct ctl_table sunrpc_table[];
-
-void
-rpc_register_sysctl(void)
-{
-	if (!sunrpc_table_header)
-		sunrpc_table_header = register_sysctl_table(sunrpc_table);
-}
-
-void
-rpc_unregister_sysctl(void)
-{
-	if (sunrpc_table_header) {
-		unregister_sysctl_table(sunrpc_table_header);
-		sunrpc_table_header = NULL;
-	}
-}
-
 static int proc_do_xprt(struct ctl_table *table, int write,
 			void *buffer, size_t *lenp, loff_t *ppos)
 {
@@ -142,6 +123,7 @@ proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp,
 	return 0;
 }
 
+static struct ctl_table_header *sunrpc_table_header;
 
 static struct ctl_table debug_table[] = {
 	{
@@ -190,4 +172,19 @@ static struct ctl_table sunrpc_table[] = {
 	{ }
 };
 
+void
+rpc_register_sysctl(void)
+{
+	if (!sunrpc_table_header)
+		sunrpc_table_header = register_sysctl_table(sunrpc_table);
+}
+
+void
+rpc_unregister_sysctl(void)
+{
+	if (sunrpc_table_header) {
+		unregister_sysctl_table(sunrpc_table_header);
+		sunrpc_table_header = NULL;
+	}
+}
 #endif
-- 
2.39.1


  parent reply	other threads:[~2023-03-11 23:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-11 23:39 [PATCH v3 0/5] sunrpc: simplfy sysctl registrations Luis Chamberlain
2023-03-11 23:39 ` [PATCH v3 1/5] sunrpc: simplify two-level sysctl registration for tsvcrdma_parm_table Luis Chamberlain
2023-03-12  1:06   ` Chuck Lever III
2023-03-12  1:15     ` Luis Chamberlain
2023-03-12  1:22       ` Chuck Lever III
2023-03-11 23:39 ` [PATCH v3 2/5] sunrpc: simplify one-level sysctl registration for xr_tunables_table Luis Chamberlain
2023-03-11 23:39 ` [PATCH v3 3/5] sunrpc: simplify one-level sysctl registration for xs_tunables_table Luis Chamberlain
2023-03-11 23:39 ` Luis Chamberlain [this message]
2023-03-11 23:39 ` [PATCH v3 5/5] sunrpc: simplify one-level sysctl registration for debug_table Luis Chamberlain
2023-03-13 10:48 ` [PATCH v3 0/5] sunrpc: simplfy sysctl registrations Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230311233944.354858-5-mcgrof@kernel.org \
    --to=mcgrof@kernel.org \
    --cc=anna@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=j.granados@samsung.com \
    --cc=jlayton@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patches@lists.linux.dev \
    --cc=trond.myklebust@hammerspace.com \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.