[PATCH] usb: storage: make US_DEBUGPX print with LOGLEVEL_DEBUG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The US_DEBUGPX macro uses printk without specifying a kernel log level, so
the default kernel log level is used, which may not match LOGLEVEL_DEBUG
used in usb_stor_dbg. Use printk_emit with LOGLEVEL_DEBUG instead.

Signed-off-by: Victor Dodon <printesoi@xxxxxxxxxxxx>
---
 drivers/usb/storage/debug.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
index f525203..fc1c02f 100644
--- a/drivers/usb/storage/debug.h
+++ b/drivers/usb/storage/debug.h
@@ -43,6 +43,7 @@
 #define _DEBUG_H_
 
 #include <linux/kernel.h>
+#include <linux/printk.h>
 
 #define USB_STORAGE "usb-storage: "
 
@@ -53,7 +54,8 @@ void usb_stor_show_sense(const struct us_data *us, unsigned char key,
 __printf(2, 3) void usb_stor_dbg(const struct us_data *us,
 				 const char *fmt, ...);
 
-#define US_DEBUGPX(fmt, ...)	printk(fmt, ##__VA_ARGS__)
+#define US_DEBUGPX(fmt, ...)					\
+	printk_emit(0, LOGLEVEL_DEBUG, NULL, 0, fmt, ##__VA_ARGS__)
 #define US_DEBUG(x)		x
 #else
 __printf(2, 3)
@@ -64,7 +66,11 @@ static inline void _usb_stor_dbg(const struct us_data *us,
 #define usb_stor_dbg(us, fmt, ...)				\
 	do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0)
 #define US_DEBUGPX(fmt, ...)					\
-	do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
+	do {							\
+		if (0)						\
+			printk_emit(0, LOGLEVEL_DEBUG, NULL, 0,	\
+				    fmt, ##__VA_ARGS__);	\
+	} while (0)
 #define US_DEBUG(x)
 #endif
 
-- 
2.7.0.rc3.207.g0ac5344

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux