Commit ff2bac6a authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

[UDP-Lite]: Clean up proc creation a bit.

Just introduce a helper to remove ifdefs from inside the
udplite4_register function. This will help to make the next patch
nicer.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 757764f6
...@@ -82,6 +82,16 @@ static struct udp_seq_afinfo udplite4_seq_afinfo = { ...@@ -82,6 +82,16 @@ static struct udp_seq_afinfo udplite4_seq_afinfo = {
.seq_show = udp4_seq_show, .seq_show = udp4_seq_show,
.seq_fops = &udplite4_seq_fops, .seq_fops = &udplite4_seq_fops,
}; };
static __init int udplite4_proc_init(void)
{
return udp_proc_register(&init_net, &udplite4_seq_afinfo);
}
#else
static inline int udplite4_proc_init(void)
{
return 0;
}
#endif #endif
void __init udplite4_register(void) void __init udplite4_register(void)
...@@ -94,10 +104,8 @@ void __init udplite4_register(void) ...@@ -94,10 +104,8 @@ void __init udplite4_register(void)
inet_register_protosw(&udplite4_protosw); inet_register_protosw(&udplite4_protosw);
#ifdef CONFIG_PROC_FS if (udplite4_proc_init())
if (udp_proc_register(&init_net, &udplite4_seq_afinfo))
printk(KERN_ERR "%s: Cannot register /proc!\n", __func__); printk(KERN_ERR "%s: Cannot register /proc!\n", __func__);
#endif
return; return;
out_unregister_proto: out_unregister_proto:
......
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