summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorJean Tourrilhes <jt@hpl.hp.com>2005-03-22 03:23:10 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2005-03-22 03:23:10 -0800
commitc6f1a030e92e5188ee086eef3e8c4348b786f368 (patch)
tree5fc5ddda7403bdb14c0a7d688865e4c44a1c7c3b /include/net
parentdf1aa060a61047b25fe16357612c20c75099d5ca (diff)
[IRDA]: DEBUG macro fixes
o [CRITICA] Eliminate all 'ASSERT(..., break;)' -> use goto; That would compile differenty with/without CONFIG_IRDA_DEBUG o [CORRECT] Add '()' to IRDA_DEBUG macro to avoid side effects o [CORRECT] Add 'do {} while(0)' to IRDA_ASSERT to avoid side effects o [FEATURE] Rename ASSERT to IRDA_ASSERT (namespace pollution) o [FEATURE] Rename MESSAGE to IRDA_MESSAGE (namespace pollution) o [FEATURE] Rename ERROR to IRDA_ERROR (namespace pollution) o [FEATURE] Disable IRDA_ASSERT when no CONFIG_IRDA_DEBUG -> footprint Signed-off-by: Jean Tourrilhes <jt@hpl.hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>'
Diffstat (limited to 'include/net')
-rw-r--r--include/net/irda/irda.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/include/net/irda/irda.h b/include/net/irda/irda.h
index 497f6a3977bd..d055e12fcf64 100644
--- a/include/net/irda/irda.h
+++ b/include/net/irda/irda.h
@@ -66,22 +66,22 @@ extern unsigned int irda_debug;
/* use 0 for production, 1 for verification, >2 for debug */
#define IRDA_DEBUG_LEVEL 0
-#define IRDA_DEBUG(n, args...) (irda_debug >= (n)) ? (printk(KERN_DEBUG args)) : 0
-#define ASSERT(expr, func) \
-if(!(expr)) { \
- printk( "Assertion failed! %s:%s:%d %s\n", \
- __FILE__,__FUNCTION__,__LINE__,(#expr)); \
- func }
+#define IRDA_DEBUG(n, args...) ( (irda_debug >= (n)) ? \
+ (printk(KERN_DEBUG args)) : \
+ 0 )
+#define IRDA_ASSERT(expr, func) \
+do { if(!(expr)) { \
+ printk( "Assertion failed! %s:%s:%d %s\n", \
+ __FILE__,__FUNCTION__,__LINE__,(#expr) ); \
+ func } } while (0)
#else
-#define IRDA_DEBUG(n, args...)
-#define ASSERT(expr, func) \
-if(!(expr)) do { \
- func } while (0)
+#define IRDA_DEBUG(n, args...) 0
+#define IRDA_ASSERT(expr, func) 0
#endif /* CONFIG_IRDA_DEBUG */
-#define WARNING(args...) printk(KERN_WARNING args)
-#define MESSAGE(args...) printk(KERN_INFO args)
-#define ERROR(args...) printk(KERN_ERR args)
+#define IRDA_WARNING(args...) printk(KERN_WARNING args)
+#define IRDA_MESSAGE(args...) printk(KERN_INFO args)
+#define IRDA_ERROR(args...) printk(KERN_ERR args)
/*
* Magic numbers used by Linux-IrDA. Random numbers which must be unique to