Commit bd8a5367 authored by Tonghao Zhang's avatar Tonghao Zhang Committed by Paolo Abeni

net: sysctl: use shared sysctl macro

This patch replace two, four and long_one to SYSCTL_XXX.

Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Cc: David Ahern <dsahern@kernel.org>
Cc: Simon Horman <horms@verge.net.au>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <kadlec@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Lorenz Bauer <lmb@cloudflare.com>
Cc: Akhmat Karakotov <hmukos@yandex-team.ru>
Signed-off-by: default avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 0530a683
...@@ -25,13 +25,11 @@ ...@@ -25,13 +25,11 @@
#include "dev.h" #include "dev.h"
static int two = 2;
static int three = 3; static int three = 3;
static int int_3600 = 3600; static int int_3600 = 3600;
static int min_sndbuf = SOCK_MIN_SNDBUF; static int min_sndbuf = SOCK_MIN_SNDBUF;
static int min_rcvbuf = SOCK_MIN_RCVBUF; static int min_rcvbuf = SOCK_MIN_RCVBUF;
static int max_skb_frags = MAX_SKB_FRAGS; static int max_skb_frags = MAX_SKB_FRAGS;
static long long_one __maybe_unused = 1;
static long long_max __maybe_unused = LONG_MAX; static long long_max __maybe_unused = LONG_MAX;
static int net_msg_warn; /* Unused, but still a sysctl */ static int net_msg_warn; /* Unused, but still a sysctl */
...@@ -390,7 +388,7 @@ static struct ctl_table net_core_table[] = { ...@@ -390,7 +388,7 @@ static struct ctl_table net_core_table[] = {
.extra2 = SYSCTL_ONE, .extra2 = SYSCTL_ONE,
# else # else
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = SYSCTL_TWO,
# endif # endif
}, },
# ifdef CONFIG_HAVE_EBPF_JIT # ifdef CONFIG_HAVE_EBPF_JIT
...@@ -401,7 +399,7 @@ static struct ctl_table net_core_table[] = { ...@@ -401,7 +399,7 @@ static struct ctl_table net_core_table[] = {
.mode = 0600, .mode = 0600,
.proc_handler = proc_dointvec_minmax_bpf_restricted, .proc_handler = proc_dointvec_minmax_bpf_restricted,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = SYSCTL_TWO,
}, },
{ {
.procname = "bpf_jit_kallsyms", .procname = "bpf_jit_kallsyms",
...@@ -419,7 +417,7 @@ static struct ctl_table net_core_table[] = { ...@@ -419,7 +417,7 @@ static struct ctl_table net_core_table[] = {
.maxlen = sizeof(long), .maxlen = sizeof(long),
.mode = 0600, .mode = 0600,
.proc_handler = proc_dolongvec_minmax_bpf_restricted, .proc_handler = proc_dolongvec_minmax_bpf_restricted,
.extra1 = &long_one, .extra1 = SYSCTL_LONG_ONE,
.extra2 = &bpf_jit_limit_max, .extra2 = &bpf_jit_limit_max,
}, },
#endif #endif
...@@ -546,7 +544,7 @@ static struct ctl_table net_core_table[] = { ...@@ -546,7 +544,7 @@ static struct ctl_table net_core_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = SYSCTL_TWO,
}, },
{ {
.procname = "devconf_inherit_init_net", .procname = "devconf_inherit_init_net",
......
...@@ -20,10 +20,7 @@ ...@@ -20,10 +20,7 @@
#include <net/protocol.h> #include <net/protocol.h>
#include <net/netevent.h> #include <net/netevent.h>
static int two = 2;
static int three __maybe_unused = 3; static int three __maybe_unused = 3;
static int four = 4;
static int thousand = 1000;
static int tcp_retr1_max = 255; static int tcp_retr1_max = 255;
static int ip_local_port_range_min[] = { 1, 1 }; static int ip_local_port_range_min[] = { 1, 1 };
static int ip_local_port_range_max[] = { 65535, 65535 }; static int ip_local_port_range_max[] = { 65535, 65535 };
...@@ -1006,7 +1003,7 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1006,7 +1003,7 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dou8vec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = SYSCTL_TWO,
}, },
{ {
.procname = "tcp_max_syn_backlog", .procname = "tcp_max_syn_backlog",
...@@ -1117,7 +1114,7 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1117,7 +1114,7 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dou8vec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &four, .extra2 = SYSCTL_FOUR,
}, },
{ {
.procname = "tcp_recovery", .procname = "tcp_recovery",
...@@ -1310,7 +1307,7 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1310,7 +1307,7 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &thousand, .extra2 = SYSCTL_ONE_THOUSAND,
}, },
{ {
.procname = "tcp_pacing_ca_ratio", .procname = "tcp_pacing_ca_ratio",
...@@ -1319,7 +1316,7 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1319,7 +1316,7 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &thousand, .extra2 = SYSCTL_ONE_THOUSAND,
}, },
{ {
.procname = "tcp_wmem", .procname = "tcp_wmem",
...@@ -1391,7 +1388,7 @@ static struct ctl_table ipv4_net_table[] = { ...@@ -1391,7 +1388,7 @@ static struct ctl_table ipv4_net_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dou8vec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = SYSCTL_TWO,
}, },
{ } { }
}; };
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#endif #endif
#include <linux/ioam6.h> #include <linux/ioam6.h>
static int two = 2;
static int three = 3; static int three = 3;
static int flowlabel_reflect_max = 0x7; static int flowlabel_reflect_max = 0x7;
static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX; static int auto_flowlabels_max = IP6_AUTO_FLOW_LABEL_MAX;
...@@ -197,7 +196,7 @@ static struct ctl_table ipv6_table_template[] = { ...@@ -197,7 +196,7 @@ static struct ctl_table ipv6_table_template[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dou8vec_minmax, .proc_handler = proc_dou8vec_minmax,
.extra1 = SYSCTL_ZERO, .extra1 = SYSCTL_ZERO,
.extra2 = &two, .extra2 = SYSCTL_TWO,
}, },
{ {
.procname = "ioam6_id", .procname = "ioam6_id",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment