From: Pavel Emelyanov <xemul@openvz.org>
To: David Miller <davem@davemloft.net>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
devel@openvz.org, Daniel Lezcano <dlezcano@fr.ibm.com>
Subject: [PATCH net-2.6.26 3/5][UDP-Lite]: Clean up proc creation a bit.
Date: Mon, 24 Mar 2008 13:50:30 +0300 [thread overview]
Message-ID: <47E78776.4010207@openvz.org> (raw)
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
next reply other threads:[~2008-03-24 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-24 10:50 Pavel Emelyanov [this message]
2008-03-24 21:58 ` [PATCH net-2.6.26 3/5][UDP-Lite]: Clean up proc creation a bit David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47E78776.4010207@openvz.org \
--to=xemul@openvz.org \
--cc=davem@davemloft.net \
--cc=devel@openvz.org \
--cc=dlezcano@fr.ibm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).