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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
f1175daa53
commit
191648d03d
@@ -47,17 +47,20 @@
|
||||
#define USB_STORAGE "usb-storage: "
|
||||
|
||||
#ifdef CONFIG_USB_STORAGE_DEBUG
|
||||
void usb_stor_show_command(struct scsi_cmnd *srb);
|
||||
void usb_stor_show_sense( unsigned char key,
|
||||
unsigned char asc, unsigned char ascq );
|
||||
__printf(1, 2) int usb_stor_dbg(const char *fmt, ...);
|
||||
void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
|
||||
void usb_stor_show_sense(const struct us_data *us, unsigned char key,
|
||||
unsigned char asc, unsigned char ascq);
|
||||
__printf(2, 3) int usb_stor_dbg(const struct us_data *us,
|
||||
const char *fmt, ...);
|
||||
|
||||
#define US_DEBUGP(fmt, ...) usb_stor_dbg(fmt, ##__VA_ARGS__)
|
||||
#define US_DEBUGPX(fmt, ...) printk(fmt, ##__VA_ARGS__)
|
||||
#define US_DEBUG(x) x
|
||||
#else
|
||||
#define US_DEBUGP(fmt, ...) \
|
||||
do { if (0) printk(fmt, ##__VA_ARGS__); } while (0)
|
||||
__printf(2, 3)
|
||||
static inline int _usb_stor_dbg(const struct us_data *us,
|
||||
const char *fmt, ...) {return 1;}
|
||||
#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)
|
||||
#define US_DEBUG(x)
|
||||
|
Reference in New Issue
Block a user