[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 <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Greg Kroah-Hartman 2005-11-17 09:48:09 -08:00 committed by Linus Torvalds
parent 87cf203935
commit 654f31189e
38 changed files with 25 additions and 139 deletions

View file

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

View file

@ -27,14 +27,9 @@
#include <linux/config.h>
/*
#define DEBUG
#define VERBOSE_DEBUG
*/
#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
# define DEBUG
#endif
#include <asm/semaphore.h>
#include <linux/atm.h>
#include <linux/atmdev.h>

View file

@ -14,3 +14,7 @@ ifeq ($(CONFIG_USB_DEVICEFS),y)
endif
obj-$(CONFIG_USB) += usbcore.o
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif

View file

@ -15,14 +15,6 @@
#include <asm/scatterlist.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "hcd.h"

View file

@ -1,9 +1,4 @@
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#endif
#include <linux/usb.h>
#include <linux/module.h>
#include <linux/init.h>

View file

@ -19,12 +19,6 @@
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/errno.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "usb.h"

View file

@ -17,13 +17,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>

View file

@ -23,11 +23,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#endif
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>

View file

@ -9,11 +9,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/module.h>

View file

@ -3,13 +3,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/pci.h> /* for scatterlist macros */
#include <linux/usb.h>
#include <linux/module.h>

View file

@ -12,13 +12,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/notifier.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "usb.h"

View file

@ -12,14 +12,7 @@
#include <linux/config.h>
#include <linux/kernel.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "usb.h"
/* endpoint stuff */

View file

@ -4,12 +4,6 @@
#include <linux/bitops.h>
#include <linux/slab.h>
#include <linux/init.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/usb.h>
#include "hcd.h"

View file

@ -22,13 +22,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/module.h>
#include <linux/string.h>
#include <linux/bitops.h>

View file

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

View file

@ -40,13 +40,6 @@
*****************************************************************************/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/input.h>

View file

@ -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);

View file

@ -40,13 +40,6 @@
*****************************************************************************/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG
#else
#undef DEBUG
#endif
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/input.h>

View file

@ -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) && \

View file

@ -30,10 +30,6 @@
#include <linux/input.h>
#include <linux/module.h>
#include <linux/init.h>
#if !defined(DEBUG) && defined(CONFIG_USB_DEBUG)
#define DEBUG
#endif
#include <linux/usb.h>
#include <linux/usb_input.h>

View file

@ -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/
obj-$(CONFIG_USB_SISUSBVGA) += sisusbvga/
ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif

View file

@ -30,7 +30,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/wait.h>
#undef DEBUG /* include debug macros until it's done */
#include <linux/usb.h>
/*-------------------------------------------------------------------*/

View file

@ -26,9 +26,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG 1
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>

View file

@ -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) {

View file

@ -10,9 +10,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
#define DEBUG 1
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>

View file

@ -1,7 +1,4 @@
#include <linux/config.h>
#if !defined (DEBUG) && defined (CONFIG_USB_DEBUG)
# define DEBUG
#endif
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/init.h>

View file

@ -41,8 +41,6 @@
/*****************************************************************************/
#define DEBUG
#include <linux/module.h>
#include <linux/socket.h>
#include <linux/parport.h>

View file

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

View file

@ -23,9 +23,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/sched.h>

View file

@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>

View file

@ -18,9 +18,6 @@
*/
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/kmod.h>
#include <linux/sched.h>

View file

@ -22,9 +22,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>

View file

@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>

View file

@ -28,8 +28,6 @@
* is out of the interrupt routine.
*/
#undef DEBUG
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/init.h>

View file

@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>

View file

@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>

View file

@ -34,9 +34,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>

View file

@ -21,9 +21,6 @@
// #define VERBOSE // more; success messages
#include <linux/config.h>
#ifdef CONFIG_USB_DEBUG
# define DEBUG
#endif
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/init.h>