Staging: hv: osd: remove LogMsg wrapper
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 16 Jul 2009 19:35:07 +0000 (12:35 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 15 Sep 2009 19:01:48 +0000 (12:01 -0700)
Use the "real" printk call instead of a wrapper function.

Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/include/logging.h
drivers/staging/hv/include/osd.h
drivers/staging/hv/osd.c

index c36eaf88b521155438dfdf5d04f174524c705f25..54af17af4f45083f92a1087046566dc53894e13a 100644 (file)
                                                        BLKVSC_DRV)
 
 // Logging Level
-#define CRITICAL_LVL                           2
-#define ERROR_LVL                                      3
-#define WARNING_LVL                                    4
-#define INFO_LVL                                       6
-#define DEBUG_LVL                                      7
+#define ERROR_LVL                              3
+#define WARNING_LVL                            4
+#define INFO_LVL                               6
+#define DEBUG_LVL                              7
 #define DEBUG_LVL_ENTEREXIT                    8
 #define DEBUG_RING_LVL                         9
 
@@ -65,44 +64,53 @@ extern unsigned int vmbus_loglevel;
 
 #define ASSERT(expr)   \
         if (!(expr)) { \
-               LogMsg("<%d>Assertion failed! %s,%s,%s,line=%d\n", CRITICAL_LVL, #expr,__FILE__,__FUNCTION__,__LINE__); \
+               printk(KERN_CRIT "Assertion failed! %s,%s,%s,line=%d\n", \
+                      #expr, __FILE__, __func__, __LINE__);    \
                __asm__ __volatile__("int3");   \
         }
 
 #define DPRINT(mod, lvl, fmt, args...) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (lvl <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() " fmt "\n", DEBUG_LVL, __FUNCTION__, ## args)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) && \
+           (lvl <= LOWORD(vmbus_loglevel)))    \
+               printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
        } while (0)
 
 #define DPRINT_DBG(mod, fmt, args...) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (DEBUG_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() " fmt "\n", DEBUG_LVL, __FUNCTION__, ## args)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) &&         \
+           (DEBUG_LVL <= LOWORD(vmbus_loglevel)))      \
+               printk(KERN_DEBUG #mod": %s() " fmt "\n", __func__, ## args);\
        } while (0)
 
 #define DPRINT_INFO(mod, fmt, args...) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (INFO_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": " fmt "\n", INFO_LVL, ## args)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) &&         \
+           (INFO_LVL <= LOWORD(vmbus_loglevel)))       \
+               printk(KERN_INFO #mod": " fmt "\n", ## args);\
        } while (0)
 
 #define DPRINT_WARN(mod, fmt, args...) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (WARNING_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": WARNING! " fmt "\n", WARNING_LVL, ## args)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) &&         \
+           (WARNING_LVL <= LOWORD(vmbus_loglevel)))    \
+           printk(KERN_WARNING #mod": WARNING! " fmt "\n", ## args);\
        } while (0)
 
 #define DPRINT_ERR(mod, fmt, args...) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (ERROR_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() ERROR!! " fmt "\n", ERROR_LVL, __FUNCTION__, ## args)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) &&         \
+           (ERROR_LVL <= LOWORD(vmbus_loglevel)))      \
+               printk(KERN_ERR #mod": %s() ERROR!! " fmt "\n", \
+                      __func__, ## args);\
        } while (0)
 
 #ifdef DEBUG
 #define DPRINT_ENTER(mod) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" "["#mod"]: %s() enter\n", DEBUG_LVL, __FUNCTION__)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) && \
+           (DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel)))    \
+           printk(KERN_DEBUG "["#mod"]: %s() enter\n", __func__);\
        } while (0)
 
 #define DPRINT_EXIT(mod) do {\
-       if (mod & (HIWORD(vmbus_loglevel))) \
-               (DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" "["#mod"]: %s() exit\n", DEBUG_LVL, __FUNCTION__)):(0);\
+       if ((mod & (HIWORD(vmbus_loglevel))) && \
+           (DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel)))    \
+               printk(KERN_DEBUG "["#mod"]: %s() exit\n", __func__);\
        } while (0)
 #else
 #define DPRINT_ENTER(mod)
@@ -113,12 +121,12 @@ static inline void PrintBytes(const unsigned char* bytes, int len)
 {
        int i=0;
 
-       LogMsg("\n<< ");
+       printk("\n<< ");
        for (i=0; i< len; i++)
        {
-               LogMsg("0x%x ", bytes[i]);
+               printk("0x%x ", bytes[i]);
        }
-       LogMsg(">>\n");
+       printk(">>\n");
 }
 
 //
index 467196d0044fe7fa4ab5431814958f202b055888..2d5cd4de983dd654b377c6afca3e7a3b03b1d5a7 100644 (file)
@@ -98,8 +98,6 @@ static inline void do_cpuid(unsigned int op, unsigned int *eax, unsigned int *eb
 //
 // Osd routines
 //
-extern void LogMsg(const char *fmt, ...);
-
 extern void BitSet(unsigned int* addr, int value);
 extern void BitClear(unsigned int* addr, int value);
 extern int BitTest(unsigned int* addr, int value);
index 7a4c4381fd4dbc0be4bfa95d6fd647cce7c51a37..42da804e99afe12c2777119b5991ac5938c00895 100644 (file)
@@ -72,19 +72,6 @@ typedef struct _WORKITEM {
 } WORKITEM;
 
 
-//
-// Global
-//
-
-void LogMsg(const char *fmt, ...)
-{
-       va_list args;
-
-       va_start(args, fmt);
-       vprintk(fmt, args);
-       va_end(args);
-}
-
 void BitSet(unsigned int* addr, int bit)
 {
        set_bit(bit, (unsigned long*)addr);