[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241003221007.12918-1-kuniyu@amazon.com>
Date: Thu, 3 Oct 2024 15:10:07 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <kerneljasonxing@...il.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kernelxing@...cent.com>,
<kuba@...nel.org>, <netdev@...r.kernel.org>, <pabeni@...hat.com>,
<willemb@...gle.com>, <willemdebruijn.kernel@...il.com>, <kuniyu@...zon.com>
Subject: Re: [PATCH net-next v3] net-timestamp: namespacify the sysctl_tstamp_allow_data
From: Jason Xing <kerneljasonxing@...il.com>
Date: Thu, 3 Oct 2024 19:40:35 +0900
> diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
> index 86a2476678c4..83622799eb80 100644
> --- a/net/core/sysctl_net_core.c
> +++ b/net/core/sysctl_net_core.c
> @@ -491,15 +491,6 @@ static struct ctl_table net_core_table[] = {
> .mode = 0644,
> .proc_handler = proc_dointvec,
> },
> - {
> - .procname = "tstamp_allow_data",
> - .data = &sysctl_tstamp_allow_data,
> - .maxlen = sizeof(int),
> - .mode = 0644,
> - .proc_handler = proc_dointvec_minmax,
> - .extra1 = SYSCTL_ZERO,
> - .extra2 = SYSCTL_ONE
> - },
> #ifdef CONFIG_RPS
> {
> .procname = "rps_sock_flow_entries",
> @@ -665,6 +656,15 @@ static struct ctl_table netns_core_table[] = {
> .extra2 = SYSCTL_ONE,
> .proc_handler = proc_dou8vec_minmax,
> },
> + {
> + .procname = "tstamp_allow_data",
> + .data = &init_net.core.sysctl_tstamp_allow_data,
> + .maxlen = sizeof(int),
> + .mode = 0644,
> + .proc_handler = proc_dointvec_minmax,
> + .extra1 = SYSCTL_ZERO,
> + .extra2 = SYSCTL_ONE
It's already limited to [0, 1], so you can use u8 and save 3 bytes.
grep -rnI proc_dou8vec_minmax.
Powered by blists - more mailing lists