Commit efcbd3df authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

USB: Extend and neaten dbg macros

Add format/argument validation for #ifndef DEBUG dbg macro
Neaten dbg macro definitions
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f45ba776
......@@ -1566,14 +1566,18 @@ extern void usb_register_notify(struct notifier_block *nb);
extern void usb_unregister_notify(struct notifier_block *nb);
#ifdef DEBUG
#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \
__FILE__ , ## arg)
#define dbg(format, arg...) \
printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg)
#else
#define dbg(format, arg...) do {} while (0)
#define dbg(format, arg...) \
do { \
if (0) \
printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
} while (0)
#endif
#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
format "\n" , ## arg)
#define err(format, arg...) \
printk(KERN_ERR KBUILD_MODNAME ": " format "\n", ##arg)
/* debugfs stuff */
extern struct dentry *usb_debug_root;
......
......@@ -352,13 +352,10 @@ static inline void usb_serial_debug_data(int debug,
/* Use our own dbg macro */
#undef dbg
#define dbg(format, arg...) \
do { \
do { \
if (debug) \
printk(KERN_DEBUG "%s: " format "\n" , __FILE__ , \
## arg); \
} while (0)
printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \
} while (0)
#endif /* __LINUX_USB_SERIAL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment