[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_9988AA3C6A8AA0A649B2F45C66243F946707@qq.com>
Date: Sat, 9 Mar 2024 18:31:21 +0800
From: wenyang.linux@...mail.com
To: "Eric W . Biederman" <ebiederm@...ssion.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Kees Cook <keescook@...omium.org>,
Joel Granados <j.granados@...sung.com>,
Christian Brauner <brauner@...nel.org>
Cc: Wen Yang <wenyang.linux@...mail.com>,
"David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 4/9] net: ipv6: delete these unnecessary static variables two_five_five and minus_one
From: Wen Yang <wenyang.linux@...mail.com>
Delete unnecessary static variables (two_five_five and minux_one)
and encode them directly in the table entry.
Signed-off-by: Wen Yang <wenyang.linux@...mail.com>
Cc: Eric W. Biederman <ebiederm@...ssion.com>
Cc: Luis Chamberlain <mcgrof@...nel.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Joel Granados <j.granados@...sung.com>
Cc: Christian Brauner <brauner@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: David Ahern <dsahern@...nel.org>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: Paolo Abeni <pabeni@...hat.com>
Cc: linux-kernel@...r.kernel.org
---
net/ipv6/addrconf.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 733ace18806c..73776ff76365 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -6660,8 +6660,6 @@ static int addrconf_sysctl_disable_policy(struct ctl_table *ctl, int write,
return ret;
}
-static int minus_one = -1;
-static const int two_five_five = 255;
static u32 ioam6_if_id_max = U16_MAX;
static const struct ctl_table addrconf_sysctl[] = {
@@ -6678,8 +6676,9 @@ static const struct ctl_table addrconf_sysctl[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)SYSCTL_ONE,
- .extra2 = (void *)&two_five_five,
+ .min = SYSCTL_NUMERIC_ONE,
+ .max = SYSCTL_NUMERIC_U8_MAX,
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
},
{
.procname = "mtu",
@@ -6722,7 +6721,8 @@ static const struct ctl_table addrconf_sysctl[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &minus_one,
+ .min = SYSCTL_NUMERIC_NEG_ONE,
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MIN,
},
{
.procname = "router_solicitation_interval",
@@ -7061,8 +7061,9 @@ static const struct ctl_table addrconf_sysctl[] = {
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = (void *)SYSCTL_ZERO,
- .extra2 = (void *)&two_five_five,
+ .min = SYSCTL_NUMERIC_ZERO,
+ .max = SYSCTL_NUMERIC_U8_MAX,
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
},
{
.procname = "rpl_seg_enabled",
--
2.25.1
Powered by blists - more mailing lists