summaryrefslogtreecommitdiffstats
path: root/include/linux/arcdevice.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-05-05 10:05:54 -0700
committerMichael Grzeschik <m.grzeschik@pengutronix.de>2015-09-23 08:44:24 +0200
commit72aeea4841c037b9b3abf65859673cbd7b6664a9 (patch)
treec3971feaa487b367d3055d39de981ad86562196b /include/linux/arcdevice.h
parentd77510f3436e0db9b5e72fa8159ce26c3ac88d2d (diff)
downloadlinux-stable-72aeea4841c037b9b3abf65859673cbd7b6664a9.tar.gz
linux-stable-72aeea4841c037b9b3abf65859673cbd7b6664a9.tar.bz2
linux-stable-72aeea4841c037b9b3abf65859673cbd7b6664a9.zip
arcnet: Expand odd BUGLVL macro with if and uses
Don't hide what should be obvious. Make the macro a simple test instead of using if and test. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Diffstat (limited to 'include/linux/arcdevice.h')
-rw-r--r--include/linux/arcdevice.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index ad610208fbba..f07c66383b88 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -78,13 +78,12 @@
#endif
extern int arcnet_debug;
-#define BUGLVL_TEST(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug)
-#define BUGLVL(x) if (BUGLVL_TEST(x))
+#define BUGLVL(x) ((x) & ARCNET_DEBUG_MAX & arcnet_debug)
/* macros to simplify debug checking */
#define BUGMSG(x, fmt, ...) \
do { \
- if (BUGLVL_TEST(x)) \
+ if (BUGLVL(x)) \
printk("%s%6s: " fmt, \
(x) == D_NORMAL ? KERN_WARNING : \
(x) < D_DURING ? KERN_INFO : KERN_DEBUG, \
@@ -93,12 +92,14 @@ do { \
#define BUGMSG2(x, fmt, ...) \
do { \
- if (BUGLVL_TEST(x)) \
+ if (BUGLVL(x)) \
printk(fmt, ##__VA_ARGS__); \
} while (0)
/* see how long a function call takes to run, expressed in CPU cycles */
-#define TIME(name, bytes, call) BUGLVL(D_TIMING) { \
+#define TIME(name, bytes, call) \
+do { \
+ if (BUGLVL(D_TIMING)) { \
unsigned long _x, _y; \
_x = get_cycles(); \
call; \
@@ -108,10 +109,10 @@ do { \
"%lu Kbytes/100Mcycle\n", \
name, bytes, _y - _x, \
100000000 / 1024 * bytes / (_y - _x + 1)); \
- } \
- else { \
+ } else { \
call; \
- }
+ } \
+} while (0)
/*
* Time needed to reset the card - in ms (milliseconds). This works on my