Skip to content

Commit

Permalink
[UDP-Lite]: Clean up proc creation a bit.
Browse files Browse the repository at this point in the history
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: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Mar 24, 2008
1 parent 757764f commit ff2bac6
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions net/ipv4/udplite.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ static struct udp_seq_afinfo udplite4_seq_afinfo = {
.seq_show = udp4_seq_show,
.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

void __init udplite4_register(void)
Expand All @@ -94,10 +104,8 @@ void __init udplite4_register(void)

inet_register_protosw(&udplite4_protosw);

#ifdef CONFIG_PROC_FS
if (udp_proc_register(&init_net, &udplite4_seq_afinfo))
if (udplite4_proc_init())
printk(KERN_ERR "%s: Cannot register /proc!\n", __func__);
#endif
return;

out_unregister_proto:
Expand Down

0 comments on commit ff2bac6

Please sign in to comment.