OpenVZ Forum


Home » Mailing lists » Devel » [PATCH net-2.6.26 3/5][UDP-Lite]: Clean up proc creation a bit.
[PATCH net-2.6.26 3/5][UDP-Lite]: Clean up proc creation a bit. [message #28558] Mon, 24 March 2008 10:50 Go to next message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
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>

---
 net/ipv4/udplite.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 8d42e34..653a6fc 100644
--- a/net/ipv4/udplite.c
+++ b/net/ipv4/udplite.c
@@ -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:
-- 
1.5.3.4
Re: [PATCH net-2.6.26 3/5][UDP-Lite]: Clean up proc creation a bit. [message #28590 is a reply to message #28558] Mon, 24 March 2008 21:58 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: Pavel Emelyanov <xemul@openvz.org>
Date: Mon, 24 Mar 2008 13:50:30 +0300

> 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>

Applied.
Previous Topic: [PATCH net-2.6.26 2/5][NETNS][TCP]: Register /proc/net/tcp in a namespace.
Next Topic: [PATCH net-2.6.26 4/5][NETNS][UDP-Lite]: Register /proc/net/udplite(6) in a namespace.
Goto Forum:
  


Current Time: Sun May 26 11:31:48 GMT 2024

Total time taken to generate the page: 0.01487 seconds