aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-06-12 02:04:25 -0400
committerDavid S. Miller <davem@davemloft.net>2013-06-13 05:36:09 -0400
commitfe2c6338fd2c6f383c4d4164262f35c8f3708e1f (patch)
tree491431ce95f0bda453b054748e3552fa6450c21c /net/ipv4
parent194f4a6df2a92c3d0bc65a85facfbc2433b25d06 (diff)
net: Convert uses of typedef ctl_table to struct ctl_table
Reduce the uses of this unnecessary typedef. Done via perl script: $ git grep --name-only -w ctl_table net | \ xargs perl -p -i -e '\ sub trim { my ($local) = @_; $local =~ s/(^\s+|\s+$)//g; return $local; } \ s/\b(?<!struct\s)ctl_table\b(\s*\*\s*|\s+\w+)/"struct ctl_table " . trim($1)/ge' Reflow the modified lines that now exceed 80 columns. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/devinet.c6
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c2
-rw-r--r--net/ipv4/route.c4
-rw-r--r--net/ipv4/sysctl_net_ipv4.c31
4 files changed, 22 insertions, 21 deletions
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 3469506c106d..8d48c392adcc 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1942,7 +1942,7 @@ static void inet_forward_change(struct net *net)
1942 } 1942 }
1943} 1943}
1944 1944
1945static int devinet_conf_proc(ctl_table *ctl, int write, 1945static int devinet_conf_proc(struct ctl_table *ctl, int write,
1946 void __user *buffer, 1946 void __user *buffer,
1947 size_t *lenp, loff_t *ppos) 1947 size_t *lenp, loff_t *ppos)
1948{ 1948{
@@ -1985,7 +1985,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
1985 return ret; 1985 return ret;
1986} 1986}
1987 1987
1988static int devinet_sysctl_forward(ctl_table *ctl, int write, 1988static int devinet_sysctl_forward(struct ctl_table *ctl, int write,
1989 void __user *buffer, 1989 void __user *buffer,
1990 size_t *lenp, loff_t *ppos) 1990 size_t *lenp, loff_t *ppos)
1991{ 1991{
@@ -2028,7 +2028,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
2028 return ret; 2028 return ret;
2029} 2029}
2030 2030
2031static int ipv4_doint_and_flush(ctl_table *ctl, int write, 2031static int ipv4_doint_and_flush(struct ctl_table *ctl, int write,
2032 void __user *buffer, 2032 void __user *buffer,
2033 size_t *lenp, loff_t *ppos) 2033 size_t *lenp, loff_t *ppos)
2034{ 2034{
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 567d84168bd2..0a2e0e3e95ba 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -223,7 +223,7 @@ static struct nf_hook_ops ipv4_conntrack_ops[] __read_mostly = {
223static int log_invalid_proto_min = 0; 223static int log_invalid_proto_min = 0;
224static int log_invalid_proto_max = 255; 224static int log_invalid_proto_max = 255;
225 225
226static ctl_table ip_ct_sysctl_table[] = { 226static struct ctl_table ip_ct_sysctl_table[] = {
227 { 227 {
228 .procname = "ip_conntrack_max", 228 .procname = "ip_conntrack_max",
229 .maxlen = sizeof(int), 229 .maxlen = sizeof(int),
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 198ea596f2d9..f3fa42eac461 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2448,7 +2448,7 @@ static int ip_rt_gc_interval __read_mostly = 60 * HZ;
2448static int ip_rt_gc_min_interval __read_mostly = HZ / 2; 2448static int ip_rt_gc_min_interval __read_mostly = HZ / 2;
2449static int ip_rt_gc_elasticity __read_mostly = 8; 2449static int ip_rt_gc_elasticity __read_mostly = 8;
2450 2450
2451static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write, 2451static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write,
2452 void __user *buffer, 2452 void __user *buffer,
2453 size_t *lenp, loff_t *ppos) 2453 size_t *lenp, loff_t *ppos)
2454{ 2454{
@@ -2463,7 +2463,7 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
2463 return -EINVAL; 2463 return -EINVAL;
2464} 2464}
2465 2465
2466static ctl_table ipv4_route_table[] = { 2466static struct ctl_table ipv4_route_table[] = {
2467 { 2467 {
2468 .procname = "gc_thresh", 2468 .procname = "gc_thresh",
2469 .data = &ipv4_dst_ops.gc_thresh, 2469 .data = &ipv4_dst_ops.gc_thresh,
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index fa2f63fc453b..b2c123c44d69 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -49,13 +49,13 @@ static void set_local_port_range(int range[2])
49} 49}
50 50
51/* Validate changes from /proc interface. */ 51/* Validate changes from /proc interface. */
52static int ipv4_local_port_range(ctl_table *table, int write, 52static int ipv4_local_port_range(struct ctl_table *table, int write,
53 void __user *buffer, 53 void __user *buffer,
54 size_t *lenp, loff_t *ppos) 54 size_t *lenp, loff_t *ppos)
55{ 55{
56 int ret; 56 int ret;
57 int range[2]; 57 int range[2];
58 ctl_table tmp = { 58 struct ctl_table tmp = {
59 .data = &range, 59 .data = &range,
60 .maxlen = sizeof(range), 60 .maxlen = sizeof(range),
61 .mode = table->mode, 61 .mode = table->mode,
@@ -100,7 +100,7 @@ static void set_ping_group_range(struct ctl_table *table, kgid_t low, kgid_t hig
100} 100}
101 101
102/* Validate changes from /proc interface. */ 102/* Validate changes from /proc interface. */
103static int ipv4_ping_group_range(ctl_table *table, int write, 103static int ipv4_ping_group_range(struct ctl_table *table, int write,
104 void __user *buffer, 104 void __user *buffer,
105 size_t *lenp, loff_t *ppos) 105 size_t *lenp, loff_t *ppos)
106{ 106{
@@ -108,7 +108,7 @@ static int ipv4_ping_group_range(ctl_table *table, int write,
108 int ret; 108 int ret;
109 gid_t urange[2]; 109 gid_t urange[2];
110 kgid_t low, high; 110 kgid_t low, high;
111 ctl_table tmp = { 111 struct ctl_table tmp = {
112 .data = &urange, 112 .data = &urange,
113 .maxlen = sizeof(urange), 113 .maxlen = sizeof(urange),
114 .mode = table->mode, 114 .mode = table->mode,
@@ -135,11 +135,11 @@ static int ipv4_ping_group_range(ctl_table *table, int write,
135 return ret; 135 return ret;
136} 136}
137 137
138static int proc_tcp_congestion_control(ctl_table *ctl, int write, 138static int proc_tcp_congestion_control(struct ctl_table *ctl, int write,
139 void __user *buffer, size_t *lenp, loff_t *ppos) 139 void __user *buffer, size_t *lenp, loff_t *ppos)
140{ 140{
141 char val[TCP_CA_NAME_MAX]; 141 char val[TCP_CA_NAME_MAX];
142 ctl_table tbl = { 142 struct ctl_table tbl = {
143 .data = val, 143 .data = val,
144 .maxlen = TCP_CA_NAME_MAX, 144 .maxlen = TCP_CA_NAME_MAX,
145 }; 145 };
@@ -153,12 +153,12 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write,
153 return ret; 153 return ret;
154} 154}
155 155
156static int proc_tcp_available_congestion_control(ctl_table *ctl, 156static int proc_tcp_available_congestion_control(struct ctl_table *ctl,
157 int write, 157 int write,
158 void __user *buffer, size_t *lenp, 158 void __user *buffer, size_t *lenp,
159 loff_t *ppos) 159 loff_t *ppos)
160{ 160{
161 ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, }; 161 struct ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, };
162 int ret; 162 int ret;
163 163
164 tbl.data = kmalloc(tbl.maxlen, GFP_USER); 164 tbl.data = kmalloc(tbl.maxlen, GFP_USER);
@@ -170,12 +170,12 @@ static int proc_tcp_available_congestion_control(ctl_table *ctl,
170 return ret; 170 return ret;
171} 171}
172 172
173static int proc_allowed_congestion_control(ctl_table *ctl, 173static int proc_allowed_congestion_control(struct ctl_table *ctl,
174 int write, 174 int write,
175 void __user *buffer, size_t *lenp, 175 void __user *buffer, size_t *lenp,
176 loff_t *ppos) 176 loff_t *ppos)
177{ 177{
178 ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX }; 178 struct ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX };
179 int ret; 179 int ret;
180 180
181 tbl.data = kmalloc(tbl.maxlen, GFP_USER); 181 tbl.data = kmalloc(tbl.maxlen, GFP_USER);
@@ -190,7 +190,7 @@ static int proc_allowed_congestion_control(ctl_table *ctl,
190 return ret; 190 return ret;
191} 191}
192 192
193static int ipv4_tcp_mem(ctl_table *ctl, int write, 193static int ipv4_tcp_mem(struct ctl_table *ctl, int write,
194 void __user *buffer, size_t *lenp, 194 void __user *buffer, size_t *lenp,
195 loff_t *ppos) 195 loff_t *ppos)
196{ 196{
@@ -201,7 +201,7 @@ static int ipv4_tcp_mem(ctl_table *ctl, int write,
201 struct mem_cgroup *memcg; 201 struct mem_cgroup *memcg;
202#endif 202#endif
203 203
204 ctl_table tmp = { 204 struct ctl_table tmp = {
205 .data = &vec, 205 .data = &vec,
206 .maxlen = sizeof(vec), 206 .maxlen = sizeof(vec),
207 .mode = ctl->mode, 207 .mode = ctl->mode,
@@ -233,10 +233,11 @@ static int ipv4_tcp_mem(ctl_table *ctl, int write,
233 return 0; 233 return 0;
234} 234}
235 235
236static int proc_tcp_fastopen_key(ctl_table *ctl, int write, void __user *buffer, 236static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,
237 size_t *lenp, loff_t *ppos) 237 void __user *buffer, size_t *lenp,
238 loff_t *ppos)
238{ 239{
239 ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) }; 240 struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) };
240 struct tcp_fastopen_context *ctxt; 241 struct tcp_fastopen_context *ctxt;
241 int ret; 242 int ret;
242 u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */ 243 u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */