mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: wenyang.linux@foxmail.com
To: Luis Chamberlain <mcgrof@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Joel Granados <j.granados@samsung.com>,
	Christian Brauner <brauner@kernel.org>,
	davem@davemloft.net, David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Wen Yang <wenyang.linux@foxmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/8] net: ipv6: delete these duplicate static variables two_five_five and minus_one
Date: Sun, 25 Feb 2024 12:05:33 +0800	[thread overview]
Message-ID: <tencent_2BAA25EAD320DD49BA7409E637BFAB67A007@qq.com> (raw)
In-Reply-To: <20240225040538.845899-1-wenyang.linux@foxmail.com>

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

Since these static variables (two_five_five and minus_one) are only used
for boundary checks and will not be changed, remove them and use the ones
in our shared const array.

Signed-off-by: Wen Yang <wenyang.linux@foxmail.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: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
 net/ipv6/addrconf.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d63f5d063f07..1d55df7d34ed 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,8 @@ 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,
+		.extra1		= SYSCTL_ONE,
+		.extra2		= SYSCTL_U8_MAX,
 	},
 	{
 		.procname	= "mtu",
@@ -6722,7 +6720,7 @@ static const struct ctl_table addrconf_sysctl[] = {
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec_minmax,
-		.extra1		= &minus_one,
+		.extra1		= SYSCTL_NEG_ONE,
 	},
 	{
 		.procname	= "router_solicitation_interval",
@@ -7061,8 +7059,8 @@ 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,
+		.extra1		= SYSCTL_ZERO,
+		.extra2		= SYSCTL_U8_MAX,
 	},
 	{
 		.procname	= "rpl_seg_enabled",
-- 
2.25.1


  parent reply	other threads:[~2024-02-25  4:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240225040538.845899-1-wenyang.linux@foxmail.com>
2024-02-25  4:05 ` [PATCH 1/8] sysctl: introduce sysctl SYSCTL_U8_MAX and SYSCTL_LONG_S32_MAX wenyang.linux
2024-02-25 20:16   ` Joel Granados
2024-02-26 14:59     ` Wen Yang
2024-02-25  4:05 ` [PATCH 2/8] rxrpc: delete these duplicate static variables n_65535 and four wenyang.linux
2024-02-25  4:05 ` wenyang.linux [this message]
2024-02-25  4:05 ` [PATCH 4/8] svcrdma: delete the duplicate static variables zero wenyang.linux
2024-02-25  4:05 ` [PATCH 5/8] sysctl: delete these duplicate static variables i_zero and i_one_hundred wenyang.linux
2024-02-25  4:05 ` [PATCH 6/8] epoll: delete these duplicate static variables long_zero and long_max wenyang.linux
2024-02-25  4:05 ` [PATCH 7/8] fs: inotify: delete these duplicate static variables it_zero and it_int_max wenyang.linux
2024-02-25  4:05 ` [PATCH 8/8] ucounts: delete these duplicate static variables ue_zero and ue_int_max wenyang.linux
2024-02-25 12:29   ` Eric W. Biederman
2024-02-25 15:21     ` Wen Yang
2024-03-21 14:28     ` Joel Granados

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_2BAA25EAD320DD49BA7409E637BFAB67A007@qq.com \
    --to=wenyang.linux@foxmail.com \
    --cc=brauner@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --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=netdev@vger.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®