Subject: Re: [PATCH net-next v3] net-timestamp: namespacify the sysctl_tstamp_allow_data

From: Kuniyuki Iwashima <[email-masked]>
Date: Thu, 3 Oct 2024 15:10:07 -0700

From: Jason Xing <[email-masked]>
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.