2024-02-25 04:08:30

by Wen Yang

[permalink] [raw]
Subject: [PATCH 4/8] svcrdma: delete the duplicate static variables zero

From: Wen Yang <[email protected]>

Since these static variable zero is only used for boundary checks and
will not be changed, remove it and use the ones in our shared const array.

Signed-off-by: Wen Yang <[email protected]>
Cc: Luis Chamberlain <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Joel Granados <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
net/sunrpc/xprtrdma/svc_rdma.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
index f86970733eb0..5e4cd17eeb5a 100644
--- a/net/sunrpc/xprtrdma/svc_rdma.c
+++ b/net/sunrpc/xprtrdma/svc_rdma.c
@@ -63,7 +63,6 @@ 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;

struct percpu_counter svcrdma_stat_read;
struct percpu_counter svcrdma_stat_recv;
@@ -170,8 +169,8 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &zero,
- .extra2 = &zero,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ZERO,
},
{
.procname = "rdma_stat_rq_poll",
@@ -179,8 +178,8 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &zero,
- .extra2 = &zero,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ZERO,
},
{
.procname = "rdma_stat_rq_prod",
@@ -188,8 +187,8 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &zero,
- .extra2 = &zero,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ZERO,
},
{
.procname = "rdma_stat_sq_poll",
@@ -197,8 +196,8 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &zero,
- .extra2 = &zero,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ZERO,
},
{
.procname = "rdma_stat_sq_prod",
@@ -206,8 +205,8 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &zero,
- .extra2 = &zero,
+ .extra1 = SYSCTL_ZERO,
+ .extra2 = SYSCTL_ZERO,
},
{ },
};
--
2.25.1