Re: [PATCH] MUSB: make DBG() calls actually depend on CONFIG_USB_MUSB_DEBUG

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

 



Hello.

I wrote:

Enabling CONFIG_USB_MUSB_DEBUG option causes -DDEBUG to be added to gcc's
command line, however the DBG() macro doesn't depend on DEBUG, so that the
debugging messages get printed regardless of the option, and I don't think
that this was intended. Make xprintk() macro used by DBG() call pr_debug()
which only results in the actual code generated if DEBUG is defined.

This change makes musb_hdrc.o ~30% less in size with CONFIG_USB_MUSB_DEBUG
disabled (in host mode).

Signed-off-by: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

--
The patch is against the recent Linus' tree...

 drivers/usb/musb/musb_debug.h |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: linux-2.6/drivers/usb/musb/musb_debug.h
===================================================================
--- linux-2.6.orig/drivers/usb/musb/musb_debug.h
+++ linux-2.6/drivers/usb/musb/musb_debug.h
@@ -42,10 +42,9 @@
 #define INFO(fmt, args...) yprintk(KERN_INFO, fmt, ## args)
 #define ERR(fmt, args...) yprintk(KERN_ERR, fmt, ## args)
-#define xprintk(level, facility, format, args...) do { \
+#define xprintk(level, format, args...) do { \
 	if (_dbg_level(level)) { \
-		printk(facility "%s %d: " format , \
-				__func__, __LINE__ , ## args); \
+		pr_debug("%s %d: " format, __func__, __LINE__, ## args); \
 	} } while (0)
extern unsigned musb_debug;
@@ -55,7 +54,7 @@ static inline int _dbg_level(unsigned l)
 	return musb_debug >= l;
 }
-#define DBG(level, fmt, args...) xprintk(level, KERN_DEBUG, fmt, ## args)
+#define DBG(level, fmt, args...) xprintk(level, fmt, ## args)
extern const char *otg_state_string(struct musb *);

  Felipe, will you queue/ack this patch?

WBR, Sergei

--
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