: Clean up proc creation a bit.
Subsystems (2)
PATCH 3/5 : 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 <[email protected]>
--- net/ipv4/udplite.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-)
net/ipv4/udplite.c +11 -3
@@ -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 )
@@ -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:
Signature · 1 line
1.5.3.4
From: Pavel Emelyanov <[email protected]>
Date: Mon, 24 Mar 2008 13:50:30 +0300
Quoted 5 lines
Just introduce a helper to remove ifdefs from inside the
udplite4_registerfunction. This will help to make the next patch nicer.Signed-off-by Pavel Emelyanov <[email protected]>
Applied.