o net: several C99 struct init style conversions and cleanups

parent 499c357d
......@@ -252,9 +252,7 @@ static int dst_dev_event(struct notifier_block *this, unsigned long event, void
}
struct notifier_block dst_dev_notifier = {
dst_dev_event,
NULL,
0
.notifier_call = dst_dev_event,
};
void __init dst_init(void)
......
......@@ -1477,112 +1477,112 @@ struct neigh_sysctl_table {
.procname = "mcast_solicit",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_UCAST_SOLICIT,
.procname = "ucast_solicit",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_APP_SOLICIT,
.procname = "app_solicit",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_RETRANS_TIME,
.procname = "retrans_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_REACHABLE_TIME,
.procname = "base_reachable_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec_jiffies,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_NEIGH_DELAY_PROBE_TIME,
.procname = "delay_first_probe_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec_jiffies,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_NEIGH_GC_STALE_TIME,
.procname = "gc_stale_time",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec_jiffies,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_NEIGH_UNRES_QLEN,
.procname = "unres_qlen",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_PROXY_QLEN,
.procname = "proxy_qlen",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_ANYCAST_DELAY,
.procname = "anycast_delay",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_PROXY_DELAY,
.procname = "proxy_delay",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_LOCKTIME,
.procname = "locktime",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_GC_INTERVAL,
.procname = "gc_interval",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec_jiffies,
.proc_handler = &proc_dointvec_jiffies,
},
{
.ctl_name = NET_NEIGH_GC_THRESH1,
.procname = "gc_thresh1",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_GC_THRESH2,
.procname = "gc_thresh2",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
{
.ctl_name = NET_NEIGH_GC_THRESH3,
.procname = "gc_thresh3",
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler =&proc_dointvec,
.proc_handler = &proc_dointvec,
},
},
.neigh_dev = {
......
......@@ -160,7 +160,9 @@ static struct timer_list whitehole_timer =
TIMER_INITIALIZER(whitehole_inject, 0, 0);
static struct net_device whitehole_dev = {
"whitehole", 0x0, 0x0, 0x0, 0x0, 0, 0, 0, 0, 0, NULL, whitehole_init, };
.name = "whitehole",
.init = whitehole_init,
};
static int whitehole_open(struct net_device *dev)
{
......
......@@ -83,23 +83,62 @@ static struct
{
int error;
u8 scope;
} fib_props[RTA_MAX+1] = {
{ 0, RT_SCOPE_NOWHERE}, /* RTN_UNSPEC */
{ 0, RT_SCOPE_UNIVERSE}, /* RTN_UNICAST */
{ 0, RT_SCOPE_HOST}, /* RTN_LOCAL */
{ 0, RT_SCOPE_LINK}, /* RTN_BROADCAST */
{ 0, RT_SCOPE_LINK}, /* RTN_ANYCAST */
{ 0, RT_SCOPE_UNIVERSE}, /* RTN_MULTICAST */
{ -EINVAL, RT_SCOPE_UNIVERSE}, /* RTN_BLACKHOLE */
{ -EHOSTUNREACH, RT_SCOPE_UNIVERSE},/* RTN_UNREACHABLE */
{ -EACCES, RT_SCOPE_UNIVERSE}, /* RTN_PROHIBIT */
{ -EAGAIN, RT_SCOPE_UNIVERSE}, /* RTN_THROW */
} fib_props[RTA_MAX + 1] = {
{
.error = 0,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_UNSPEC */
{
.error = 0,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_UNICAST */
{
.error = 0,
.scope = RT_SCOPE_HOST,
}, /* RTN_LOCAL */
{
.error = 0,
.scope = RT_SCOPE_LINK,
}, /* RTN_BROADCAST */
{
.error = 0,
.scope = RT_SCOPE_LINK,
}, /* RTN_ANYCAST */
{
.error = 0,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_MULTICAST */
{
.error = -EINVAL,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_BLACKHOLE */
{
.error = -EHOSTUNREACH,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_UNREACHABLE */
{
.error = -EACCES,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_PROHIBIT */
{
.error = -EAGAIN,
.scope = RT_SCOPE_UNIVERSE,
}, /* RTN_THROW */
#ifdef CONFIG_IP_ROUTE_NAT
{ 0, RT_SCOPE_HOST}, /* RTN_NAT */
{
.error = 0,
.scope = RT_SCOPE_HOST,
}, /* RTN_NAT */
#else
{ -EINVAL, RT_SCOPE_NOWHERE}, /* RTN_NAT */
{
.error = -EINVAL,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_NAT */
#endif
{ -EINVAL, RT_SCOPE_NOWHERE} /* RTN_XRESOLVE */
{
.error = -EINVAL,
.scope = RT_SCOPE_NOWHERE,
}, /* RTN_XRESOLVE */
};
......
......@@ -132,18 +132,17 @@ static int ipv6_chk_same_addr(const struct in6_addr *addr, struct net_device *de
static struct notifier_block *inet6addr_chain;
struct ipv6_devconf ipv6_devconf =
{
0, /* forwarding */
IPV6_DEFAULT_HOPLIMIT, /* hop limit */
IPV6_MIN_MTU, /* mtu */
1, /* accept RAs */
1, /* accept redirects */
1, /* autoconfiguration */
1, /* dad transmits */
MAX_RTR_SOLICITATIONS, /* router solicits */
RTR_SOLICITATION_INTERVAL, /* rtr solicit interval */
MAX_RTR_SOLICITATION_DELAY, /* rtr solicit delay */
struct ipv6_devconf ipv6_devconf = {
.forwarding = 0,
.hop_limit = IPV6_DEFAULT_HOPLIMIT,
.mtu6 = IPV6_MIN_MTU,
.accept_ra = 1,
.accept_redirects = 1,
.autoconf = 1,
.dad_transmits = 1,
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
.rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY,
#ifdef CONFIG_IPV6_PRIVACY
.use_tempaddr = 0,
.temp_valid_lft = TEMP_VALID_LIFETIME,
......@@ -153,18 +152,17 @@ struct ipv6_devconf ipv6_devconf =
#endif
};
static struct ipv6_devconf ipv6_devconf_dflt =
{
0, /* forwarding */
IPV6_DEFAULT_HOPLIMIT, /* hop limit */
IPV6_MIN_MTU, /* mtu */
1, /* accept RAs */
1, /* accept redirects */
1, /* autoconfiguration */
1, /* dad transmits */
MAX_RTR_SOLICITATIONS, /* router solicits */
RTR_SOLICITATION_INTERVAL, /* rtr solicit interval */
MAX_RTR_SOLICITATION_DELAY, /* rtr solicit delay */
static struct ipv6_devconf ipv6_devconf_dflt = {
.forwarding = 0,
.hop_limit = IPV6_DEFAULT_HOPLIMIT,
.mtu6 = IPV6_MIN_MTU,
.accept_ra = 1,
.accept_redirects = 1,
.autoconf = 1,
.dad_transmits = 1,
.rtr_solicits = MAX_RTR_SOLICITATIONS,
.rtr_solicit_interval = RTR_SOLICITATION_INTERVAL,
.rtr_solicit_delay = MAX_RTR_SOLICITATION_DELAY,
#ifdef CONFIG_IPV6_PRIVACY
.use_tempaddr = 0,
.temp_valid_lft = TEMP_VALID_LIFETIME,
......
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