dcb: Add stub routines for !CONFIG_DCB
authorJohn Fastabend <john.r.fastabend@intel.com>
Thu, 6 Oct 2011 08:52:44 +0000 (08:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Oct 2011 19:49:51 +0000 (15:49 -0400)
To avoid ifdefs in the other code that supports DCB notifiers
add stub routines. This method seems popular in other net code
for example 8021Q.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dcbevent.h

index bc1e7ef40171cc3871383f0876c09ced56e6ff9a..443626ed4cbc4daba803c58dfc76128c5c0f5b67 100644 (file)
@@ -24,8 +24,26 @@ enum dcbevent_notif_type {
        DCB_APP_EVENT = 1,
 };
 
+#ifdef CONFIG_DCB
 extern int register_dcbevent_notifier(struct notifier_block *nb);
 extern int unregister_dcbevent_notifier(struct notifier_block *nb);
 extern int call_dcbevent_notifiers(unsigned long val, void *v);
+#else
+static inline int
+register_dcbevent_notifier(struct notifier_block *nb)
+{
+       return 0;
+}
+
+static inline int unregister_dcbevent_notifier(struct notifier_block *nb)
+{
+       return 0;
+}
+
+static inline int call_dcbevent_notifiers(unsigned long val, void *v)
+{
+       return 0;
+}
+#endif /* CONFIG_DCB */
 
 #endif