From: Victor Dodon <printesoi@chromium.org>
To: linux-kernel@vger.kernel.org
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
Gwendal Grignou <gwendal@chromium.org>
Subject: [PATCH] usb: storage: make US_DEBUGPX print with LOGLEVEL_DEBUG
Date: Wed, 10 Feb 2016 16:13:43 -0800 [thread overview]
Message-ID: <20160211001343.GA133746@printesoi1.mtv.corp.google.com> (raw)
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@chromium.org>
---
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
next reply other threads:[~2016-02-11 0:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-11 0:13 Victor Dodon [this message]
2016-02-15 1:20 ` Greg Kroah-Hartman
2016-02-16 23:45 ` Victor Dodon
2016-02-17 0:40 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160211001343.GA133746@printesoi1.mtv.corp.google.com \
--to=printesoi@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=gwendal@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=usb-storage@lists.one-eyed-alien.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®