Commit ff2bac6a63e3694e7a97152b7e934fe244e2a858

Authored by Pavel Emelyanov
Committed by David S. Miller
1 parent 757764f61d

[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: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 11 additions and 3 deletions Side-by-side Diff

... ... @@ -82,6 +82,16 @@
82 82 .seq_show = udp4_seq_show,
83 83 .seq_fops = &udplite4_seq_fops,
84 84 };
  85 +
  86 +static __init int udplite4_proc_init(void)
  87 +{
  88 + return udp_proc_register(&init_net, &udplite4_seq_afinfo);
  89 +}
  90 +#else
  91 +static inline int udplite4_proc_init(void)
  92 +{
  93 + return 0;
  94 +}
85 95 #endif
86 96  
87 97 void __init udplite4_register(void)
88 98  
... ... @@ -94,10 +104,8 @@
94 104  
95 105 inet_register_protosw(&udplite4_protosw);
96 106  
97   -#ifdef CONFIG_PROC_FS
98   - if (udp_proc_register(&init_net, &udplite4_seq_afinfo))
  107 + if (udplite4_proc_init())
99 108 printk(KERN_ERR "%s: Cannot register /proc!\n", __func__);
100   -#endif
101 109 return;
102 110  
103 111 out_unregister_proto: