Skip to content

Commit fe2c633

Browse files
JoePerchesdavem330
authored andcommitted
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>
1 parent 194f4a6 commit fe2c633

32 files changed

Lines changed: 86 additions & 85 deletions

‎net/ax25/sysctl_net_ax25.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static int min_proto[1], max_proto[] = { AX25_PROTO_MAX };
2929
static int min_ds_timeout[1], max_ds_timeout[] = {65535000};
3030
#endif
3131

32-
static const ctl_table ax25_param_table[] = {
32+
static const struct ctl_table ax25_param_table[] = {
3333
{
3434
.procname = "ip_default_mode",
3535
.maxlen = sizeof(int),

‎net/bridge/br_netfilter.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ static struct nf_hook_ops br_nf_ops[] __read_mostly = {
992992

993993
#ifdef CONFIG_SYSCTL
994994
static
995-
int brnf_sysctl_call_tables(ctl_table * ctl, int write,
995+
int brnf_sysctl_call_tables(struct ctl_table *ctl, int write,
996996
void __user * buffer, size_t * lenp, loff_t * ppos)
997997
{
998998
int ret;
@@ -1004,7 +1004,7 @@ int brnf_sysctl_call_tables(ctl_table * ctl, int write,
10041004
return ret;
10051005
}
10061006

1007-
static ctl_table brnf_table[] = {
1007+
static struct ctl_table brnf_table[] = {
10081008
{
10091009
.procname = "bridge-nf-call-arptables",
10101010
.data = &brnf_call_arptables,

‎net/core/neighbour.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2765,11 +2765,11 @@ EXPORT_SYMBOL(neigh_app_ns);
27652765
static int zero;
27662766
static int unres_qlen_max = INT_MAX / SKB_TRUESIZE(ETH_FRAME_LEN);
27672767

2768-
static int proc_unres_qlen(ctl_table *ctl, int write, void __user *buffer,
2769-
size_t *lenp, loff_t *ppos)
2768+
static int proc_unres_qlen(struct ctl_table *ctl, int write,
2769+
void __user *buffer, size_t *lenp, loff_t *ppos)
27702770
{
27712771
int size, ret;
2772-
ctl_table tmp = *ctl;
2772+
struct ctl_table tmp = *ctl;
27732773

27742774
tmp.extra1 = &zero;
27752775
tmp.extra2 = &unres_qlen_max;

‎net/core/sysctl_net_core.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
static int one = 1;
2525

2626
#ifdef CONFIG_RPS
27-
static int rps_sock_flow_sysctl(ctl_table *table, int write,
27+
static int rps_sock_flow_sysctl(struct ctl_table *table, int write,
2828
void __user *buffer, size_t *lenp, loff_t *ppos)
2929
{
3030
unsigned int orig_size, size;
3131
int ret, i;
32-
ctl_table tmp = {
32+
struct ctl_table tmp = {
3333
.data = &size,
3434
.maxlen = sizeof(size),
3535
.mode = table->mode
@@ -91,7 +91,7 @@ static int rps_sock_flow_sysctl(ctl_table *table, int write,
9191
#ifdef CONFIG_NET_FLOW_LIMIT
9292
static DEFINE_MUTEX(flow_limit_update_mutex);
9393

94-
static int flow_limit_cpu_sysctl(ctl_table *table, int write,
94+
static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
9595
void __user *buffer, size_t *lenp,
9696
loff_t *ppos)
9797
{
@@ -156,7 +156,7 @@ static int flow_limit_cpu_sysctl(ctl_table *table, int write,
156156
return ret;
157157
}
158158

159-
static int flow_limit_table_len_sysctl(ctl_table *table, int write,
159+
static int flow_limit_table_len_sysctl(struct ctl_table *table, int write,
160160
void __user *buffer, size_t *lenp,
161161
loff_t *ppos)
162162
{

‎net/decnet/dn_dev.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ static int max_t3[] = { 8191 }; /* Must fit in 16 bits when multiplied by BCT3MU
158158
static int min_priority[1];
159159
static int max_priority[] = { 127 }; /* From DECnet spec */
160160

161-
static int dn_forwarding_proc(ctl_table *, int,
161+
static int dn_forwarding_proc(struct ctl_table *, int,
162162
void __user *, size_t *, loff_t *);
163163
static struct dn_dev_sysctl_table {
164164
struct ctl_table_header *sysctl_header;
165-
ctl_table dn_dev_vars[5];
165+
struct ctl_table dn_dev_vars[5];
166166
} dn_dev_sysctl = {
167167
NULL,
168168
{
@@ -242,7 +242,7 @@ static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
242242
}
243243
}
244244

245-
static int dn_forwarding_proc(ctl_table *table, int write,
245+
static int dn_forwarding_proc(struct ctl_table *table, int write,
246246
void __user *buffer,
247247
size_t *lenp, loff_t *ppos)
248248
{

‎net/decnet/sysctl_net_decnet.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ static int parse_addr(__le16 *addr, char *str)
132132
return 0;
133133
}
134134

135-
static int dn_node_address_handler(ctl_table *table, int write,
135+
static int dn_node_address_handler(struct ctl_table *table, int write,
136136
void __user *buffer,
137137
size_t *lenp, loff_t *ppos)
138138
{
@@ -183,7 +183,7 @@ static int dn_node_address_handler(ctl_table *table, int write,
183183
return 0;
184184
}
185185

186-
static int dn_def_dev_handler(ctl_table *table, int write,
186+
static int dn_def_dev_handler(struct ctl_table *table, int write,
187187
void __user *buffer,
188188
size_t *lenp, loff_t *ppos)
189189
{
@@ -246,7 +246,7 @@ static int dn_def_dev_handler(ctl_table *table, int write,
246246
return 0;
247247
}
248248

249-
static ctl_table dn_table[] = {
249+
static struct ctl_table dn_table[] = {
250250
{
251251
.procname = "node_address",
252252
.maxlen = 7,

‎net/ipv4/devinet.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ static void inet_forward_change(struct net *net)
19421942
}
19431943
}
19441944

1945-
static int devinet_conf_proc(ctl_table *ctl, int write,
1945+
static int devinet_conf_proc(struct ctl_table *ctl, int write,
19461946
void __user *buffer,
19471947
size_t *lenp, loff_t *ppos)
19481948
{
@@ -1985,7 +1985,7 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
19851985
return ret;
19861986
}
19871987

1988-
static int devinet_sysctl_forward(ctl_table *ctl, int write,
1988+
static int devinet_sysctl_forward(struct ctl_table *ctl, int write,
19891989
void __user *buffer,
19901990
size_t *lenp, loff_t *ppos)
19911991
{
@@ -2028,7 +2028,7 @@ static int devinet_sysctl_forward(ctl_table *ctl, int write,
20282028
return ret;
20292029
}
20302030

2031-
static int ipv4_doint_and_flush(ctl_table *ctl, int write,
2031+
static int ipv4_doint_and_flush(struct ctl_table *ctl, int write,
20322032
void __user *buffer,
20332033
size_t *lenp, loff_t *ppos)
20342034
{

‎net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static struct nf_hook_ops ipv4_conntrack_ops[] __read_mostly = {
223223
static int log_invalid_proto_min = 0;
224224
static int log_invalid_proto_max = 255;
225225

226-
static ctl_table ip_ct_sysctl_table[] = {
226+
static struct ctl_table ip_ct_sysctl_table[] = {
227227
{
228228
.procname = "ip_conntrack_max",
229229
.maxlen = sizeof(int),

‎net/ipv4/route.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,7 @@ static int ip_rt_gc_interval __read_mostly = 60 * HZ;
24482448
static int ip_rt_gc_min_interval __read_mostly = HZ / 2;
24492449
static int ip_rt_gc_elasticity __read_mostly = 8;
24502450

2451-
static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
2451+
static int ipv4_sysctl_rtcache_flush(struct ctl_table *__ctl, int write,
24522452
void __user *buffer,
24532453
size_t *lenp, loff_t *ppos)
24542454
{
@@ -2463,7 +2463,7 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
24632463
return -EINVAL;
24642464
}
24652465

2466-
static ctl_table ipv4_route_table[] = {
2466+
static struct ctl_table ipv4_route_table[] = {
24672467
{
24682468
.procname = "gc_thresh",
24692469
.data = &ipv4_dst_ops.gc_thresh,

‎net/ipv4/sysctl_net_ipv4.c‎

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ static void set_local_port_range(int range[2])
4949
}
5050

5151
/* Validate changes from /proc interface. */
52-
static int ipv4_local_port_range(ctl_table *table, int write,
52+
static int ipv4_local_port_range(struct ctl_table *table, int write,
5353
void __user *buffer,
5454
size_t *lenp, loff_t *ppos)
5555
{
5656
int ret;
5757
int range[2];
58-
ctl_table tmp = {
58+
struct ctl_table tmp = {
5959
.data = &range,
6060
.maxlen = sizeof(range),
6161
.mode = table->mode,
@@ -100,15 +100,15 @@ static void set_ping_group_range(struct ctl_table *table, kgid_t low, kgid_t hig
100100
}
101101

102102
/* Validate changes from /proc interface. */
103-
static int ipv4_ping_group_range(ctl_table *table, int write,
103+
static int ipv4_ping_group_range(struct ctl_table *table, int write,
104104
void __user *buffer,
105105
size_t *lenp, loff_t *ppos)
106106
{
107107
struct user_namespace *user_ns = current_user_ns();
108108
int ret;
109109
gid_t urange[2];
110110
kgid_t low, high;
111-
ctl_table tmp = {
111+
struct ctl_table tmp = {
112112
.data = &urange,
113113
.maxlen = sizeof(urange),
114114
.mode = table->mode,
@@ -135,11 +135,11 @@ static int ipv4_ping_group_range(ctl_table *table, int write,
135135
return ret;
136136
}
137137

138-
static int proc_tcp_congestion_control(ctl_table *ctl, int write,
138+
static int proc_tcp_congestion_control(struct ctl_table *ctl, int write,
139139
void __user *buffer, size_t *lenp, loff_t *ppos)
140140
{
141141
char val[TCP_CA_NAME_MAX];
142-
ctl_table tbl = {
142+
struct ctl_table tbl = {
143143
.data = val,
144144
.maxlen = TCP_CA_NAME_MAX,
145145
};
@@ -153,12 +153,12 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write,
153153
return ret;
154154
}
155155

156-
static int proc_tcp_available_congestion_control(ctl_table *ctl,
156+
static int proc_tcp_available_congestion_control(struct ctl_table *ctl,
157157
int write,
158158
void __user *buffer, size_t *lenp,
159159
loff_t *ppos)
160160
{
161-
ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, };
161+
struct ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX, };
162162
int ret;
163163

164164
tbl.data = kmalloc(tbl.maxlen, GFP_USER);
@@ -170,12 +170,12 @@ static int proc_tcp_available_congestion_control(ctl_table *ctl,
170170
return ret;
171171
}
172172

173-
static int proc_allowed_congestion_control(ctl_table *ctl,
173+
static int proc_allowed_congestion_control(struct ctl_table *ctl,
174174
int write,
175175
void __user *buffer, size_t *lenp,
176176
loff_t *ppos)
177177
{
178-
ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX };
178+
struct ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX };
179179
int ret;
180180

181181
tbl.data = kmalloc(tbl.maxlen, GFP_USER);
@@ -190,7 +190,7 @@ static int proc_allowed_congestion_control(ctl_table *ctl,
190190
return ret;
191191
}
192192

193-
static int ipv4_tcp_mem(ctl_table *ctl, int write,
193+
static int ipv4_tcp_mem(struct ctl_table *ctl, int write,
194194
void __user *buffer, size_t *lenp,
195195
loff_t *ppos)
196196
{
@@ -201,7 +201,7 @@ static int ipv4_tcp_mem(ctl_table *ctl, int write,
201201
struct mem_cgroup *memcg;
202202
#endif
203203

204-
ctl_table tmp = {
204+
struct ctl_table tmp = {
205205
.data = &vec,
206206
.maxlen = sizeof(vec),
207207
.mode = ctl->mode,
@@ -233,10 +233,11 @@ static int ipv4_tcp_mem(ctl_table *ctl, int write,
233233
return 0;
234234
}
235235

236-
static int proc_tcp_fastopen_key(ctl_table *ctl, int write, void __user *buffer,
237-
size_t *lenp, loff_t *ppos)
236+
static int proc_tcp_fastopen_key(struct ctl_table *ctl, int write,
237+
void __user *buffer, size_t *lenp,
238+
loff_t *ppos)
238239
{
239-
ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) };
240+
struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) };
240241
struct tcp_fastopen_context *ctxt;
241242
int ret;
242243
u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */

0 commit comments

Comments
 (0)