Staging: et131x: Cleanup et131x_debug.h defines
authorStoyan Gaydarov <stoyboyker@gmail.com>
Thu, 17 Jul 2008 10:29:06 +0000 (10:29 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 6 Jan 2009 21:52:07 +0000 (13:52 -0800)
This patch cleans up the et131x_debug.h defines as well as fix the
checkpatch warnings

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/et131x/et131x_debug.h

index dab608031d0b3ab5a1f82f1c2e5fd0239d4e4b67..4275638c0cc8071482e7924a1261c877d35dd5f9 100644 (file)
 #define DBG_LVL        3
 #endif /* DBG_LVL */
 
-#define DBG_DEFAULTS           (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON )
+#define DBG_DEFAULTS           (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON)
 
-#define DBG_FLAGS(A)           (A)->dbgFlags
-#define DBG_NAME(A)            (A)->dbgName
-#define DBG_LEVEL(A)           (A)->dbgLevel
+#define DBG_FLAGS(A)           ((A)->dbgFlags)
+#define DBG_NAME(A)            ((A)->dbgName)
+#define DBG_LEVEL(A)           ((A)->dbgLevel)
 
 #ifndef DBG_PRINT
 #define DBG_PRINT(S...)                printk(KERN_DEBUG S)
 #define _DBG_LEAVE(A)  printk(KERN_DEBUG "%s:%.*s:%s\n", DBG_NAME(A),  \
                                DBG_LEVEL(A)--, _LEAVE_STR, __func__)
 
-#define DBG_ENTER(A)        {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
-                                _DBG_ENTER(A);}
+#define DBG_ENTER(A)                                                   \
+       do {                                                            \
+               if (DBG_FLAGS(A) & DBG_TRACE_ON)                        \
+                       _DBG_ENTER(A);                                  \
+       } while (0)
+
+#define DBG_LEAVE(A)                                                   \
+       do {                                                            \
+               if (DBG_FLAGS(A) & DBG_TRACE_ON)                        \
+                       _DBG_LEAVE(A);                                  \
+       } while (0)
+
+#define DBG_PARAM(A, N, F, S...)                                       \
+       do {                                                            \
+               if (DBG_FLAGS(A) & DBG_PARAM_ON)                        \
+                       DBG_PRINT("  %s -- "F" ", N, S);                \
+       } while (0)
+
+#define DBG_ERROR(A, S...)                                              \
+       do {                                                             \
+               if (DBG_FLAGS(A) & DBG_ERROR_ON) {                       \
+                       DBG_PRINT("%s:ERROR:%s ", DBG_NAME(A), __func__);\
+                       DBG_PRINTC(S);                                   \
+                       DBG_TRAP;                                        \
+               }                                                        \
+       } while (0)
+
+#define DBG_WARNING(A, S...)                                               \
+       do {                                                                \
+               if (DBG_FLAGS(A) & DBG_WARNING_ON) {                        \
+                       DBG_PRINT("%s:WARNING:%s ", DBG_NAME(A), __func__); \
+                       DBG_PRINTC(S);                                      \
+               }                                                           \
+       } while (0)
+
+#define DBG_NOTICE(A, S...)                                               \
+       do {                                                               \
+               if (DBG_FLAGS(A) & DBG_NOTICE_ON) {                        \
+                       DBG_PRINT("%s:NOTICE:%s ", DBG_NAME(A), __func__); \
+                       DBG_PRINTC(S);                                     \
+               }                                                          \
+       } while (0)
+
+#define DBG_TRACE(A, S...)                                               \
+       do {                                                              \
+               if (DBG_FLAGS(A) & DBG_TRACE_ON) {                        \
+                       DBG_PRINT("%s:TRACE:%s ", DBG_NAME(A), __func__); \
+                       DBG_PRINTC(S);                                    \
+               }                                                         \
+       } while (0)
+
+#define DBG_VERBOSE(A, S...)                                               \
+       do {                                                                \
+               if (DBG_FLAGS(A) & DBG_VERBOSE_ON) {                        \
+                       DBG_PRINT("%s:VERBOSE:%s ", DBG_NAME(A), __func__); \
+                       DBG_PRINTC(S);                                      \
+               }                                                           \
+       } while (0)
+
+#define DBG_RX(A, S...)                                \
+       do {                                    \
+               if (DBG_FLAGS(A) & DBG_RX_ON)   \
+                       DBG_PRINT(S);           \
+       } while (0)
+
+#define DBG_RX_ENTER(A)                                \
+       do {                                    \
+               if (DBG_FLAGS(A) & DBG_RX_ON)   \
+                       _DBG_ENTER(A);          \
+       } while (0)
+
+#define DBG_RX_LEAVE(A)                                \
+       do {                                    \
+               if (DBG_FLAGS(A) & DBG_RX_ON)   \
+                       _DBG_LEAVE(A);          \
+       } while (0)
+
+#define DBG_TX(A, S...)                                \
+       do {                                    \
+               if (DBG_FLAGS(A) & DBG_TX_ON)   \
+                       DBG_PRINT(S);           \
+       } while (0)
+
+#define DBG_TX_ENTER(A)                                \
+       do {                                    \
+               if (DBG_FLAGS(A) & DBG_TX_ON)   \
+                       _DBG_ENTER(A);          \
+       } while (0)
+
+#define DBG_TX_LEAVE(A)                                \
+       do {                                    \
+               if (DBG_FLAGS(A) & DBG_TX_ON)   \
+                       _DBG_LEAVE(A);          \
+       } while (0)
+
+#define DBG_ASSERT(C)                                          \
+       do {                                                    \
+               if (!(C)) {                                     \
+                       DBG_PRINT("ASSERT(%s) -- %s#%d (%s) ", \
+                            #C, __FILE__, __LINE__, __func__); \
+                       DBG_TRAP;                               \
+               }
+       } while (0)
 
-#define DBG_LEAVE(A)        {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
-                                _DBG_LEAVE(A);}
-
-#define DBG_PARAM(A,N,F,S...)   {if (DBG_FLAGS(A) & DBG_PARAM_ON) \
-                                    DBG_PRINT("  %s -- "F"\n",N,S);}
-
-#define DBG_ERROR(A,S...)      \
-       if (DBG_FLAGS(A) & DBG_ERROR_ON) {                              \
-               DBG_PRINT("%s:ERROR:%s ",DBG_NAME(A), __func__);        \
-               DBG_PRINTC(S);                                          \
-               DBG_TRAP;                                               \
-       }
-
-#define DBG_WARNING(A,S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) \
-                                {DBG_PRINT("%s:WARNING:%s ",DBG_NAME(A),__func__);DBG_PRINTC(S);}}
-
-#define DBG_NOTICE(A,S...)  {if (DBG_FLAGS(A) & DBG_NOTICE_ON) \
-                                {DBG_PRINT("%s:NOTICE:%s ",DBG_NAME(A),__func__);DBG_PRINTC(S);}}
-
-#define DBG_TRACE(A,S...)   {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
-                                {DBG_PRINT("%s:TRACE:%s ",DBG_NAME(A), __func__);DBG_PRINTC(S);}}
-
-#define DBG_VERBOSE(A,S...) {if (DBG_FLAGS(A) & DBG_VERBOSE_ON) \
-                                {DBG_PRINT("%s:VERBOSE:%s ",DBG_NAME(A), __func__);DBG_PRINTC(S);}}
-
-#define DBG_RX(A,S...)      {if (DBG_FLAGS(A) & DBG_RX_ON) \
-                                {DBG_PRINT(S);}}
-
-#define DBG_RX_ENTER(A)     {if (DBG_FLAGS(A) & DBG_RX_ON) \
-                                _DBG_ENTER(A);}
-
-#define DBG_RX_LEAVE(A)     {if (DBG_FLAGS(A) & DBG_RX_ON) \
-                                _DBG_LEAVE(A);}
-
-#define DBG_TX(A,S...)      {if (DBG_FLAGS(A) & DBG_TX_ON) \
-                                {DBG_PRINT(S);}}
-
-#define DBG_TX_ENTER(A)     {if (DBG_FLAGS(A) & DBG_TX_ON) \
-                                _DBG_ENTER(A);}
-
-#define DBG_TX_LEAVE(A)     {if (DBG_FLAGS(A) & DBG_TX_ON) \
-                                _DBG_LEAVE(A);}
-
-#define DBG_ASSERT(C)       {if (!(C)) \
-                                {DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
-                                    #C,__FILE__,__LINE__,__func__); \
-                                DBG_TRAP;}}
 #define STATIC
 
 typedef struct {