diff options
author | Joe Perches <joe@perches.com> | 2013-04-19 14:44:00 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-04-19 14:46:50 -0400 |
commit | 191648d03d20229523d9a75b8abef56421298d28 (patch) | |
tree | 2de4891a95fe1d2ee4b8326bb9834033b763d37e /drivers/usb/storage/debug.h | |
parent | f1175daa5312dd1b3f5940413c7c41ed195066f7 (diff) |
usb: storage: Convert US_DEBUGP to usb_stor_dbg
Use a more current logging style with dev_printk
where possible.
o Convert uses of US_DEBUGP to usb_stor_dbg
o Add "struct us_data *" to usb_stor_dbg uses
o usb_stor_dbg now uses struct device */dev_vprint_emit
o Removed embedded function names
o Coalesce formats
o Remove trailing whitespace
o Remove useless OOM messages
o Remove useless function entry/exit logging
o Convert some US_DEBUGP uses to dev_info and dev_dbg
Object size is slightly reduced when debugging
is enabled, slightly increased with no debugging
because some initialization and removal messages
are now always emitted.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/storage/debug.h')
-rw-r--r-- | drivers/usb/storage/debug.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h index d4280e1541a3..b1273f03e223 100644 --- a/drivers/usb/storage/debug.h +++ b/drivers/usb/storage/debug.h | |||
@@ -47,17 +47,20 @@ | |||
47 | #define USB_STORAGE "usb-storage: " | 47 | #define USB_STORAGE "usb-storage: " |
48 | 48 | ||
49 | #ifdef CONFIG_USB_STORAGE_DEBUG | 49 | #ifdef CONFIG_USB_STORAGE_DEBUG |
50 | void usb_stor_show_command(struct scsi_cmnd *srb); | 50 | void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb); |
51 | void usb_stor_show_sense( unsigned char key, | 51 | void usb_stor_show_sense(const struct us_data *us, unsigned char key, |
52 | unsigned char asc, unsigned char ascq ); | 52 | unsigned char asc, unsigned char ascq); |
53 | __printf(1, 2) int usb_stor_dbg(const char *fmt, ...); | 53 | __printf(2, 3) int usb_stor_dbg(const struct us_data *us, |
54 | const char *fmt, ...); | ||
54 | 55 | ||
55 | #define US_DEBUGP(fmt, ...) usb_stor_dbg(fmt, ##__VA_ARGS__) | ||
56 | #define US_DEBUGPX(fmt, ...) printk(fmt, ##__VA_ARGS__) | 56 | #define US_DEBUGPX(fmt, ...) printk(fmt, ##__VA_ARGS__) |
57 | #define US_DEBUG(x) x | 57 | #define US_DEBUG(x) x |
58 | #else | 58 | #else |
59 | #define US_DEBUGP(fmt, ...) \ | 59 | __printf(2, 3) |
60 | do { if (0) printk(fmt, ##__VA_ARGS__); } while (0) | 60 | static inline int _usb_stor_dbg(const struct us_data *us, |
61 | const char *fmt, ...) {return 1;} | ||
62 | #define usb_stor_dbg(us, fmt, ...) \ | ||
63 | do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0) | ||
61 | #define US_DEBUGPX(fmt, ...) \ | 64 | #define US_DEBUGPX(fmt, ...) \ |
62 | do { if (0) printk(fmt, ##__VA_ARGS__); } while (0) | 65 | do { if (0) printk(fmt, ##__VA_ARGS__); } while (0) |
63 | #define US_DEBUG(x) | 66 | #define US_DEBUG(x) |