From: Stephen Hemminger <shemminger@osdl.org>
To: Ben Greear <greearb@candelatech.com>,
"David S. Miller" <davem@redhat.com>
Cc: "Linux 802.1Q VLAN" <vlan@wanfear.com>, netdev@oss.sgi.com
Subject: [PATCH] Vlan convert stubs to no-ops
Date: Mon, 28 Jul 2003 15:21:14 -0700 [thread overview]
Message-ID: <20030728152114.02a10f4e.shemminger@osdl.org> (raw)
When building without /proc, the interfaces can be converted to no-ops
(very minor code savings).
Patch for 2.6.0-test2
diff -Nru a/net/8021q/Makefile b/net/8021q/Makefile
--- a/net/8021q/Makefile Mon Jul 28 15:05:58 2003
+++ b/net/8021q/Makefile Mon Jul 28 15:05:58 2003
@@ -4,4 +4,9 @@
obj-$(CONFIG_VLAN_8021Q) += 8021q.o
-8021q-objs := vlan.o vlanproc.o vlan_dev.o
+8021q-objs := vlan.o vlan_dev.o
+
+ifeq ($(CONFIG_PROC_FS),y)
+8021q-objs += vlanproc.o
+endif
+
diff -Nru a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
--- a/net/8021q/vlanproc.c Mon Jul 28 15:05:58 2003
+++ b/net/8021q/vlanproc.c Mon Jul 28 15:05:58 2003
@@ -38,8 +38,6 @@
/****** Function Prototypes *************************************************/
-#ifdef CONFIG_PROC_FS
-
/* Proc filesystem interface */
static ssize_t vlan_proc_read(struct file *file, char *buf, size_t count,
loff_t *ppos);
@@ -438,32 +436,3 @@
return cnt;
}
-
-#else /* No CONFIG_PROC_FS */
-
-/*
- * No /proc - output stubs
- */
-
-int __init vlan_proc_init (void)
-{
- return 0;
-}
-
-void vlan_proc_cleanup(void)
-{
- return;
-}
-
-
-int vlan_proc_add_dev(struct net_device *vlandev)
-{
- return 0;
-}
-
-int vlan_proc_rem_dev(struct net_device *vlandev)
-{
- return 0;
-}
-
-#endif /* No CONFIG_PROC_FS */
diff -Nru a/net/8021q/vlanproc.h b/net/8021q/vlanproc.h
--- a/net/8021q/vlanproc.h Mon Jul 28 15:05:58 2003
+++ b/net/8021q/vlanproc.h Mon Jul 28 15:05:58 2003
@@ -1,6 +1,7 @@
#ifndef __BEN_VLAN_PROC_INC__
#define __BEN_VLAN_PROC_INC__
+#ifdef CONFIG_PROC_FS
int vlan_proc_init(void);
int vlan_proc_rem_dev(struct net_device *vlandev);
@@ -8,5 +9,14 @@
void vlan_proc_cleanup (void);
#define VLAN_PROC_BUFSZ (4096) /* buffer size for printing proc info */
+
+#else /* No CONFIG_PROC_FS */
+
+#define vlan_proc_init() (0)
+#define vlan_proc_cleanup() do {} while(0)
+#define vlan_proc_add_dev(dev) ((void)(dev), 0)
+#define vlan_proc_rem_dev(dev) ((void)(dev), 0)
+
+#endif
#endif /* !(__BEN_VLAN_PROC_INC__) */
next reply other threads:[~2003-07-28 22:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-28 22:21 Stephen Hemminger [this message]
2003-07-28 23:28 ` [PATCH] Vlan convert stubs to no-ops David S. 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=20030728152114.02a10f4e.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=davem@redhat.com \
--cc=greearb@candelatech.com \
--cc=netdev@oss.sgi.com \
--cc=vlan@wanfear.com \
/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).