[openib-general] [IBAT][PATCH] simplify debug/warn enable/disable

James Lentini jlentini at netapp.com
Fri Sep 9 13:07:00 PDT 2005


Simplify the enabling/disabling of debugging and warning messages in 
IBAT.

Signed-off-by: James Lentini <jlentini at netapp.com>

Index: infiniband/core/at_priv.h
===================================================================
--- infiniband/core/at_priv.h	(revision 3345)
+++ infiniband/core/at_priv.h	(working copy)
@@ -132,15 +132,21 @@ static const struct ib_field ats_rec_tab
 #define IB_ATS_LAST_SERVICE_ID          cpu_to_be64(0x10000ce1ff415453ULL)
 #define IB_ATS_OPENIB_MAGIC_KEY         cpu_to_be16(IB_OPENIB_OUI & 0xffff)
 
-//#define WARN(fmt, ...)	while (0) {}
-//#define WARN_VAR(x, y...)
-#define DEBUG(fmt, ...)	while (0) {}
-#define DEBUG_VAR(x, y...)
-
+#if 1
 #define WARN(fmt, arg...)	printk("ib_at: %s: " fmt "\n", __FUNCTION__ , ## arg);
 #define WARN_VAR(x, y...)	x, ## y
-//#define DEBUG(fmt, arg...)	printk("ib_at: %s: " fmt "\n", __FUNCTION__ , ## arg);
-//#define DEBUG_VAR(x, y...)	x, ## y
+#else
+#define WARN(fmt, ...)	while (0) {}
+#define WARN_VAR(x, y...)
+#endif
+
+#if 0
+#define DEBUG(fmt, arg...)	printk("ib_at: %s: " fmt "\n", __FUNCTION__ , ## arg);
+#define DEBUG_VAR(x, y...)	x, ## y
+#else
+#define DEBUG(fmt, ...)	while (0) {}
+#define DEBUG_VAR(x, y...)
+#endif
 
 static kmem_cache_t *route_req_cache = NULL;
 static kmem_cache_t *path_req_cache = NULL;
-------------- next part --------------
Index: infiniband/core/at_priv.h
===================================================================
--- infiniband/core/at_priv.h	(revision 3345)
+++ infiniband/core/at_priv.h	(working copy)
@@ -132,15 +132,21 @@ static const struct ib_field ats_rec_tab
 #define IB_ATS_LAST_SERVICE_ID          cpu_to_be64(0x10000ce1ff415453ULL)
 #define IB_ATS_OPENIB_MAGIC_KEY         cpu_to_be16(IB_OPENIB_OUI & 0xffff)
 
-//#define WARN(fmt, ...)	while (0) {}
-//#define WARN_VAR(x, y...)
-#define DEBUG(fmt, ...)	while (0) {}
-#define DEBUG_VAR(x, y...)
-
+#if 1
 #define WARN(fmt, arg...)	printk("ib_at: %s: " fmt "\n", __FUNCTION__ , ## arg);
 #define WARN_VAR(x, y...)	x, ## y
-//#define DEBUG(fmt, arg...)	printk("ib_at: %s: " fmt "\n", __FUNCTION__ , ## arg);
-//#define DEBUG_VAR(x, y...)	x, ## y
+#else
+#define WARN(fmt, ...)	while (0) {}
+#define WARN_VAR(x, y...)
+#endif
+
+#if 0
+#define DEBUG(fmt, arg...)	printk("ib_at: %s: " fmt "\n", __FUNCTION__ , ## arg);
+#define DEBUG_VAR(x, y...)	x, ## y
+#else
+#define DEBUG(fmt, ...)	while (0) {}
+#define DEBUG_VAR(x, y...)
+#endif
 
 static kmem_cache_t *route_req_cache = NULL;
 static kmem_cache_t *path_req_cache = NULL;


More information about the general mailing list