mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: wenyang.linux@foxmail.com
To: "Eric W . Biederman" <ebiederm@xmission.com>,
	Luis Chamberlain <mcgrof@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Joel Granados <j.granados@samsung.com>,
	Christian Brauner <brauner@kernel.org>
Cc: Wen Yang <wenyang.linux@foxmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/9] svcrdma: delete these unnecessary static variables min_ord, max_ord, etc
Date: Sat,  9 Mar 2024 18:31:22 +0800	[thread overview]
Message-ID: <tencent_AE6183E8272FD2DD98F5FCC69E05AA54A809@qq.com> (raw)
In-Reply-To: <cover.1709978655.git.wenyang.linux@foxmail.com>

From: Wen Yang <wenyang.linux@foxmail.com>

Delete unnecessary static variables (min_ord, max_ord, etc.)
and encode them directly in the table entry.

Signed-off-by: Wen Yang <wenyang.linux@foxmail.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Joel Granados <j.granados@samsung.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: David Ahern <dsahern@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: linux-kernel@vger.kernel.org
---
 net/sunrpc/xprtrdma/svc_rdma.c | 21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
index f86970733eb0..98cde9c2bf5a 100644
--- a/net/sunrpc/xprtrdma/svc_rdma.c
+++ b/net/sunrpc/xprtrdma/svc_rdma.c
@@ -53,15 +53,9 @@
 
 /* RPC/RDMA parameters */
 unsigned int svcrdma_ord = 16;	/* historical default */
-static unsigned int min_ord = 1;
-static unsigned int max_ord = 255;
 unsigned int svcrdma_max_requests = RPCRDMA_MAX_REQUESTS;
 unsigned int svcrdma_max_bc_requests = RPCRDMA_MAX_BC_REQUESTS;
-static unsigned int min_max_requests = 4;
-static unsigned int max_max_requests = 16384;
 unsigned int svcrdma_max_req_size = RPCRDMA_DEF_INLINE_THRESH;
-static unsigned int min_max_inline = RPCRDMA_DEF_INLINE_THRESH;
-static unsigned int max_max_inline = RPCRDMA_MAX_INLINE_THRESH;
 static unsigned int svcrdma_stat_unused;
 static unsigned int zero;
 
@@ -114,8 +108,9 @@ static struct ctl_table svcrdma_parm_table[] = {
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
-		.extra1		= &min_max_requests,
-		.extra2		= &max_max_requests
+		.min		= SYSCTL_NUMERIC_FOUR,
+		.max		= SYSCTL_NUMERIC_16K,
+		.extra_flags	= SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
 	},
 	{
 		.procname	= "max_req_size",
@@ -123,8 +118,9 @@ static struct ctl_table svcrdma_parm_table[] = {
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
-		.extra1		= &min_max_inline,
-		.extra2		= &max_max_inline
+		.min		= RPCRDMA_DEF_INLINE_THRESH,
+		.max		= RPCRDMA_MAX_INLINE_THRESH,
+		.extra_flags	= SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
 	},
 	{
 		.procname	= "max_outbound_read_requests",
@@ -132,8 +128,9 @@ static struct ctl_table svcrdma_parm_table[] = {
 		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
-		.extra1		= &min_ord,
-		.extra2		= &max_ord,
+		.min		= SYSCTL_NUMERIC_ONE,
+		.max		= SYSCTL_NUMERIC_U8_MAX,
+		.extra_flags	= SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
 	},
 
 	{
-- 
2.25.1


  parent reply	other threads:[~2024-03-09 10:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1709978655.git.wenyang.linux@foxmail.com>
2024-03-09 10:31 ` [PATCH v2 1/9] sysctl: support encoding values directly in the table entry wenyang.linux
2024-03-21 16:27   ` Joel Granados
2024-03-22 15:43     ` Wen Yang
2024-03-25  9:55       ` Joel Granados
2024-03-09 10:31 ` [PATCH v2 2/9] kernel/sysctl-test: add some kunit test cases for min/max detection wenyang.linux
2024-03-09 10:31 ` [PATCH v2 3/9] rxrpc: delete these unnecessary static variables n_65535, four, max_500, etc wenyang.linux
2024-03-09 10:31 ` [PATCH v2 4/9] net: ipv6: delete these unnecessary static variables two_five_five and minus_one wenyang.linux
2024-03-09 10:31 ` wenyang.linux [this message]
2024-03-09 10:31 ` [PATCH v2 6/9] sysctl: delete these unnecessary static variables i_zero and i_one_hundred wenyang.linux
2024-03-09 10:31 ` [PATCH v2 7/9] epoll: delete these unnecessary static variables long_zero and long_max wenyang.linux
2024-03-09 10:31 ` [PATCH v2 8/9] fs: inotify: delete these unnecessary static variables it_zero and it_int_max wenyang.linux
2024-03-09 10:31 ` [PATCH v2 9/9] ucounts: delete these unnecessary static variables ue_zero and ue_int_max wenyang.linux

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=tencent_AE6183E8272FD2DD98F5FCC69E05AA54A809@qq.com \
    --to=wenyang.linux@foxmail.com \
    --cc=brauner@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=j.granados@samsung.com \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®