From 654f31189e550cd5924b786487a5d93d9feaada9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 17 Nov 2005 09:48:09 -0800 Subject: [PATCH] [PATCH] USB: move CONFIG_USB_DEBUG checks into the Makefile This lets us remove a lot of code in the drivers that were all checking the same thing. It also found some bugs in a few of the drivers, which has been fixed up. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- drivers/usb/atm/Makefile | 4 ++++ drivers/usb/atm/usbatm.h | 5 ----- drivers/usb/core/Makefile | 4 ++++ drivers/usb/core/buffer.c | 8 -------- drivers/usb/core/config.c | 5 ----- drivers/usb/core/file.c | 6 ------ drivers/usb/core/hcd-pci.c | 7 ------- drivers/usb/core/hcd.c | 5 ----- drivers/usb/core/hub.c | 5 ----- drivers/usb/core/message.c | 7 ------- drivers/usb/core/notify.c | 6 ------ drivers/usb/core/sysfs.c | 7 ------- drivers/usb/core/urb.c | 6 ------ drivers/usb/core/usb.c | 7 ------- drivers/usb/input/Makefile | 4 ++++ drivers/usb/input/itmtouch.c | 7 ------- drivers/usb/input/keyspan_remote.c | 5 +++-- drivers/usb/input/mtouchusb.c | 7 ------- drivers/usb/input/pid.c | 2 -- drivers/usb/input/touchkitusb.c | 4 ---- drivers/usb/misc/Makefile | 6 +++++- drivers/usb/misc/auerswald.c | 1 - drivers/usb/misc/phidgetservo.c | 3 --- drivers/usb/misc/rio500.c | 2 +- drivers/usb/misc/usbled.c | 3 --- drivers/usb/misc/usbtest.c | 3 --- drivers/usb/misc/uss720.c | 2 -- drivers/usb/net/Makefile | 4 ++++ drivers/usb/net/asix.c | 3 --- drivers/usb/net/cdc_ether.c | 3 --- drivers/usb/net/cdc_subset.c | 3 --- drivers/usb/net/gl620a.c | 3 --- drivers/usb/net/net1080.c | 3 --- drivers/usb/net/pegasus.c | 2 -- drivers/usb/net/plusb.c | 3 --- drivers/usb/net/rndis_host.c | 3 --- drivers/usb/net/usbnet.c | 3 --- drivers/usb/net/zaurus.c | 3 --- 38 files changed, 25 insertions(+), 139 deletions(-) diff --git a/drivers/usb/atm/Makefile b/drivers/usb/atm/Makefile index 751f297..8509971 100644 --- a/drivers/usb/atm/Makefile +++ b/drivers/usb/atm/Makefile @@ -6,3 +6,7 @@ obj-$(CONFIG_USB_CXACRU) += cxacru.o obj-$(CONFIG_USB_SPEEDTOUCH) += speedtch.o obj-$(CONFIG_USB_ATM) += usbatm.o obj-$(CONFIG_USB_XUSBATM) += xusbatm.o + +ifeq ($(CONFIG_USB_DEBUG),y) +EXTRA_CFLAGS += -DDEBUG +endif diff --git a/drivers/usb/atm/usbatm.h b/drivers/usb/atm/usbatm.h index 9366464..1adacd6 100644 --- a/drivers/usb/atm/usbatm.h +++ b/drivers/usb/atm/usbatm.h @@ -27,14 +27,9 @@ #include /* -#define DEBUG #define VERBOSE_DEBUG */ -#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG) -# define DEBUG -#endif - #include #include #include diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile index dd1c4d2..86d5c38 100644 --- a/drivers/usb/core/Makefile +++ b/drivers/usb/core/Makefile @@ -14,3 +14,7 @@ ifeq ($(CONFIG_USB_DEVICEFS),y) endif obj-$(CONFIG_USB) += usbcore.o + +ifeq ($(CONFIG_USB_DEBUG),y) +EXTRA_CFLAGS += -DDEBUG +endif diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c index 57e800a..419c994 100644 --- a/drivers/usb/core/buffer.c +++ b/drivers/usb/core/buffer.c @@ -15,14 +15,6 @@ #include #include #include - - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include #include "hcd.h" diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 9930195..a9d89c7 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -1,9 +1,4 @@ #include - -#ifdef CONFIG_USB_DEBUG -#define DEBUG -#endif - #include #include #include diff --git a/drivers/usb/core/file.c b/drivers/usb/core/file.c index e695308..37b1336 100644 --- a/drivers/usb/core/file.c +++ b/drivers/usb/core/file.c @@ -19,12 +19,6 @@ #include #include #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif #include #include "usb.h" diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index 84d9e69..7feb829 100644 --- a/drivers/usb/core/hcd-pci.c +++ b/drivers/usb/core/hcd-pci.c @@ -17,13 +17,6 @@ */ #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include #include #include diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 6c7ca5b..5e5f65a 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -23,11 +23,6 @@ */ #include - -#ifdef CONFIG_USB_DEBUG -#define DEBUG -#endif - #include #include #include diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 256d9f6..8407279 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -9,11 +9,6 @@ */ #include -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif #include #include #include diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 208c6bd..fe74f99 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -3,13 +3,6 @@ */ #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include /* for scatterlist macros */ #include #include diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c index 37da059..fbbebab 100644 --- a/drivers/usb/core/notify.c +++ b/drivers/usb/core/notify.c @@ -12,13 +12,7 @@ #include #include #include -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif #include - #include "usb.h" diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index edd83e0..71d8813 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -12,14 +12,7 @@ #include #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif #include - #include "usb.h" /* endpoint stuff */ diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index f2a1fed..0817967 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c @@ -4,12 +4,6 @@ #include #include #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif #include #include "hcd.h" diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 0eefff7..e197ce9 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -22,13 +22,6 @@ */ #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include #include #include diff --git a/drivers/usb/input/Makefile b/drivers/usb/input/Makefile index 5e03b93..07cb17d 100644 --- a/drivers/usb/input/Makefile +++ b/drivers/usb/input/Makefile @@ -42,3 +42,7 @@ obj-$(CONFIG_USB_ACECAD) += acecad.o obj-$(CONFIG_USB_YEALINK) += yealink.o obj-$(CONFIG_USB_XPAD) += xpad.o obj-$(CONFIG_USB_APPLETOUCH) += appletouch.o + +ifeq ($(CONFIG_USB_DEBUG),y) +EXTRA_CFLAGS += -DDEBUG +endif diff --git a/drivers/usb/input/itmtouch.c b/drivers/usb/input/itmtouch.c index 3b58185..4a50acb 100644 --- a/drivers/usb/input/itmtouch.c +++ b/drivers/usb/input/itmtouch.c @@ -40,13 +40,6 @@ *****************************************************************************/ #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include #include #include diff --git a/drivers/usb/input/keyspan_remote.c b/drivers/usb/input/keyspan_remote.c index 5b8d65f..a32cfe5 100644 --- a/drivers/usb/input/keyspan_remote.c +++ b/drivers/usb/input/keyspan_remote.c @@ -160,7 +160,8 @@ static int keyspan_load_tester(struct usb_keyspan* dev, int bits_needed) * though so it's not too big a deal */ if (dev->data.pos >= dev->data.len) { - dev_dbg(&dev->udev, "%s - Error ran out of data. pos: %d, len: %d\n", + dev_dbg(&dev->udev->dev, + "%s - Error ran out of data. pos: %d, len: %d\n", __FUNCTION__, dev->data.pos, dev->data.len); return -1; } @@ -306,7 +307,7 @@ static void keyspan_check_data(struct usb_keyspan *remote, struct pt_regs *regs) err("Bad message recieved, no stop bit found.\n"); } - dev_dbg(&remote->udev, + dev_dbg(&remote->udev->dev, "%s found valid message: system: %d, button: %d, toggle: %d\n", __FUNCTION__, message.system, message.button, message.toggle); diff --git a/drivers/usb/input/mtouchusb.c b/drivers/usb/input/mtouchusb.c index 7fce526..52cc18c 100644 --- a/drivers/usb/input/mtouchusb.c +++ b/drivers/usb/input/mtouchusb.c @@ -40,13 +40,6 @@ *****************************************************************************/ #include - -#ifdef CONFIG_USB_DEBUG - #define DEBUG -#else - #undef DEBUG -#endif - #include #include #include diff --git a/drivers/usb/input/pid.c b/drivers/usb/input/pid.c index dca5ee9..19e015d 100644 --- a/drivers/usb/input/pid.c +++ b/drivers/usb/input/pid.c @@ -37,8 +37,6 @@ #include "hid.h" #include "pid.h" -#define DEBUG - #define CHECK_OWNERSHIP(i, hid_pid) \ ((i) < FF_EFFECTS_MAX && i >= 0 && \ test_bit(FF_PID_FLAGS_USED, &hid_pid->effects[(i)].flags) && \ diff --git a/drivers/usb/input/touchkitusb.c b/drivers/usb/input/touchkitusb.c index 0043e6e..7420c6b 100644 --- a/drivers/usb/input/touchkitusb.c +++ b/drivers/usb/input/touchkitusb.c @@ -30,10 +30,6 @@ #include #include #include - -#if !defined(DEBUG) && defined(CONFIG_USB_DEBUG) -#define DEBUG -#endif #include #include diff --git a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile index 862e40a..6c693bc 100644 --- a/drivers/usb/misc/Makefile +++ b/drivers/usb/misc/Makefile @@ -18,4 +18,8 @@ obj-$(CONFIG_USB_RIO500) += rio500.o obj-$(CONFIG_USB_TEST) += usbtest.o obj-$(CONFIG_USB_USS720) += uss720.o -obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/ \ No newline at end of file +obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/ + +ifeq ($(CONFIG_USB_DEBUG),y) +EXTRA_CFLAGS += -DDEBUG +endif diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c index 5f33f7c..2a28cee 100644 --- a/drivers/usb/misc/auerswald.c +++ b/drivers/usb/misc/auerswald.c @@ -30,7 +30,6 @@ #include #include #include -#undef DEBUG /* include debug macros until it's done */ #include /*-------------------------------------------------------------------*/ diff --git a/drivers/usb/misc/phidgetservo.c b/drivers/usb/misc/phidgetservo.c index b84eda6..a30d4a6 100644 --- a/drivers/usb/misc/phidgetservo.c +++ b/drivers/usb/misc/phidgetservo.c @@ -26,9 +26,6 @@ */ #include -#ifdef CONFIG_USB_DEBUG -#define DEBUG 1 -#endif #include #include #include diff --git a/drivers/usb/misc/rio500.c b/drivers/usb/misc/rio500.c index 7d02d8e..9590dba 100644 --- a/drivers/usb/misc/rio500.c +++ b/drivers/usb/misc/rio500.c @@ -393,7 +393,7 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) ibuf, this_read, &partial, 8000); - dbg(KERN_DEBUG "read stats: result:%d this_read:%u partial:%u", + dbg("read stats: result:%d this_read:%u partial:%u", result, this_read, partial); if (partial) { diff --git a/drivers/usb/misc/usbled.c b/drivers/usb/misc/usbled.c index f6ba4c7..3c93921 100644 --- a/drivers/usb/misc/usbled.c +++ b/drivers/usb/misc/usbled.c @@ -10,9 +10,6 @@ */ #include -#ifdef CONFIG_USB_DEBUG - #define DEBUG 1 -#endif #include #include #include diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 2997f55..605a2af 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1,7 +1,4 @@ #include -#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG) -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index 0592cb5..1cabe7e 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -41,8 +41,6 @@ /*****************************************************************************/ -#define DEBUG - #include #include #include diff --git a/drivers/usb/net/Makefile b/drivers/usb/net/Makefile index 222c049..a21e6ea 100644 --- a/drivers/usb/net/Makefile +++ b/drivers/usb/net/Makefile @@ -16,3 +16,7 @@ obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o obj-$(CONFIG_USB_USBNET) += usbnet.o obj-$(CONFIG_USB_ZD1201) += zd1201.o + +ifeq ($(CONFIG_USB_DEBUG),y) +EXTRA_CFLAGS += -DDEBUG +endif diff --git a/drivers/usb/net/asix.c b/drivers/usb/net/asix.c index 252a34f..542120e 100644 --- a/drivers/usb/net/asix.c +++ b/drivers/usb/net/asix.c @@ -23,9 +23,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/cdc_ether.c b/drivers/usb/net/cdc_ether.c index 652b04b..c008c98 100644 --- a/drivers/usb/net/cdc_ether.c +++ b/drivers/usb/net/cdc_ether.c @@ -21,9 +21,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/cdc_subset.c b/drivers/usb/net/cdc_subset.c index f1730b6..f05cfb8 100644 --- a/drivers/usb/net/cdc_subset.c +++ b/drivers/usb/net/cdc_subset.c @@ -18,9 +18,6 @@ */ #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/gl620a.c b/drivers/usb/net/gl620a.c index c0f263b..2455e9a 100644 --- a/drivers/usb/net/gl620a.c +++ b/drivers/usb/net/gl620a.c @@ -22,9 +22,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/net1080.c b/drivers/usb/net/net1080.c index cee55f8..b3799b1 100644 --- a/drivers/usb/net/net1080.c +++ b/drivers/usb/net/net1080.c @@ -21,9 +21,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index 537eb18..683e3df 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c @@ -28,8 +28,6 @@ * is out of the interrupt routine. */ -#undef DEBUG - #include #include #include diff --git a/drivers/usb/net/plusb.c b/drivers/usb/net/plusb.c index 74c2b35..89856aa 100644 --- a/drivers/usb/net/plusb.c +++ b/drivers/usb/net/plusb.c @@ -21,9 +21,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/rndis_host.c b/drivers/usb/net/rndis_host.c index b5a925d..c0ecbab 100644 --- a/drivers/usb/net/rndis_host.c +++ b/drivers/usb/net/rndis_host.c @@ -21,9 +21,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c index 74f05c9..362d690 100644 --- a/drivers/usb/net/usbnet.c +++ b/drivers/usb/net/usbnet.c @@ -34,9 +34,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include diff --git a/drivers/usb/net/zaurus.c b/drivers/usb/net/zaurus.c index 5d4b7d5..680d139 100644 --- a/drivers/usb/net/zaurus.c +++ b/drivers/usb/net/zaurus.c @@ -21,9 +21,6 @@ // #define VERBOSE // more; success messages #include -#ifdef CONFIG_USB_DEBUG -# define DEBUG -#endif #include #include #include -- 2.7.4