From: Greg Kroah-Hartman <gregkh@suse.de>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, linux-usb-devel@lists.sourceforge.net
Subject: [patch 20/22] USB: move CONFIG_USB_DEBUG checks into the Makefile
Date: Thu, 17 Nov 2005 09:48:05 -0800 [thread overview]
Message-ID: <20051117174805.GU11174@kroah.com> (raw)
In-Reply-To: <20051117174609.GA11174@kroah.com>
[-- Attachment #1: usb-makefile-debug.patch --]
[-- Type: text/plain, Size: 14147 bytes --]
From: Greg Kroah-Hartman <gregkh@suse.de>
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>
---
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(-)
--- usb-2.6.orig/drivers/usb/core/Makefile
+++ usb-2.6/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
--- usb-2.6.orig/drivers/usb/core/buffer.c
+++ usb-2.6/drivers/usb/core/buffer.c
@@ -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"
--- usb-2.6.orig/drivers/usb/core/config.c
+++ usb-2.6/drivers/usb/core/config.c
@@ -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>
--- usb-2.6.orig/drivers/usb/core/file.c
+++ usb-2.6/drivers/usb/core/file.c
@@ -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"
--- usb-2.6.orig/drivers/usb/core/hcd-pci.c
+++ usb-2.6/drivers/usb/core/hcd-pci.c
@@ -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>
--- usb-2.6.orig/drivers/usb/core/hcd.c
+++ usb-2.6/drivers/usb/core/hcd.c
@@ -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>
--- usb-2.6.orig/drivers/usb/core/hub.c
+++ usb-2.6/drivers/usb/core/hub.c
@@ -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>
--- usb-2.6.orig/drivers/usb/core/message.c
+++ usb-2.6/drivers/usb/core/message.c
@@ -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>
--- usb-2.6.orig/drivers/usb/core/notify.c
+++ usb-2.6/drivers/usb/core/notify.c
@@ -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"
--- usb-2.6.orig/drivers/usb/core/sysfs.c
+++ usb-2.6/drivers/usb/core/sysfs.c
@@ -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 */
--- usb-2.6.orig/drivers/usb/core/urb.c
+++ usb-2.6/drivers/usb/core/urb.c
@@ -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"
--- usb-2.6.orig/drivers/usb/core/usb.c
+++ usb-2.6/drivers/usb/core/usb.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/Makefile
+++ usb-2.6/drivers/usb/net/Makefile
@@ -16,3 +16,7 @@ obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_
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
--- usb-2.6.orig/drivers/usb/net/asix.c
+++ usb-2.6/drivers/usb/net/asix.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/cdc_ether.c
+++ usb-2.6/drivers/usb/net/cdc_ether.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/cdc_subset.c
+++ usb-2.6/drivers/usb/net/cdc_subset.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/gl620a.c
+++ usb-2.6/drivers/usb/net/gl620a.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/net1080.c
+++ usb-2.6/drivers/usb/net/net1080.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/pegasus.c
+++ usb-2.6/drivers/usb/net/pegasus.c
@@ -28,8 +28,6 @@
* is out of the interrupt routine.
*/
-#undef DEBUG
-
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/init.h>
--- usb-2.6.orig/drivers/usb/net/plusb.c
+++ usb-2.6/drivers/usb/net/plusb.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/rndis_host.c
+++ usb-2.6/drivers/usb/net/rndis_host.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/usbnet.c
+++ usb-2.6/drivers/usb/net/usbnet.c
@@ -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>
--- usb-2.6.orig/drivers/usb/net/zaurus.c
+++ usb-2.6/drivers/usb/net/zaurus.c
@@ -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>
--- usb-2.6.orig/drivers/usb/input/Makefile
+++ usb-2.6/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
--- usb-2.6.orig/drivers/usb/input/itmtouch.c
+++ usb-2.6/drivers/usb/input/itmtouch.c
@@ -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>
--- usb-2.6.orig/drivers/usb/input/mtouchusb.c
+++ usb-2.6/drivers/usb/input/mtouchusb.c
@@ -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>
--- usb-2.6.orig/drivers/usb/input/touchkitusb.c
+++ usb-2.6/drivers/usb/input/touchkitusb.c
@@ -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>
--- usb-2.6.orig/drivers/usb/input/pid.c
+++ usb-2.6/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) && \
--- usb-2.6.orig/drivers/usb/input/keyspan_remote.c
+++ usb-2.6/drivers/usb/input/keyspan_remote.c
@@ -160,7 +160,8 @@ static int keyspan_load_tester(struct us
* 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 us
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);
--- usb-2.6.orig/drivers/usb/misc/Makefile
+++ usb-2.6/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
--- usb-2.6.orig/drivers/usb/misc/phidgetservo.c
+++ usb-2.6/drivers/usb/misc/phidgetservo.c
@@ -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>
--- usb-2.6.orig/drivers/usb/misc/usbled.c
+++ usb-2.6/drivers/usb/misc/usbled.c
@@ -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>
--- usb-2.6.orig/drivers/usb/misc/usbtest.c
+++ usb-2.6/drivers/usb/misc/usbtest.c
@@ -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>
--- usb-2.6.orig/drivers/usb/misc/auerswald.c
+++ usb-2.6/drivers/usb/misc/auerswald.c
@@ -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>
/*-------------------------------------------------------------------*/
--- usb-2.6.orig/drivers/usb/misc/rio500.c
+++ usb-2.6/drivers/usb/misc/rio500.c
@@ -393,7 +393,7 @@ read_rio(struct file *file, char __user
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) {
--- usb-2.6.orig/drivers/usb/misc/uss720.c
+++ usb-2.6/drivers/usb/misc/uss720.c
@@ -41,8 +41,6 @@
/*****************************************************************************/
-#define DEBUG
-
#include <linux/module.h>
#include <linux/socket.h>
#include <linux/parport.h>
--- usb-2.6.orig/drivers/usb/atm/Makefile
+++ usb-2.6/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
--- usb-2.6.orig/drivers/usb/atm/usbatm.h
+++ usb-2.6/drivers/usb/atm/usbatm.h
@@ -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>
--
next prev parent reply other threads:[~2005-11-17 18:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20051117174227.007572000@press.kroah.org>
2005-11-17 17:46 ` [patch 00/22] USB patches for 2.6.15-rc1 Greg Kroah-Hartman
2005-11-17 17:46 ` [patch 01/22] USB: fix build breakage in dummy_hcd.c Greg Kroah-Hartman
2005-11-17 17:46 ` [patch 02/22] USB Serial: rename ChangeLog.old Greg Kroah-Hartman
2005-11-17 17:46 ` [patch 03/22] USB: add new wacom devices to usb hid-core list Greg Kroah-Hartman
2005-11-17 17:46 ` [patch 06/22] USB: Delete leftovers from bluetty driver Greg Kroah-Hartman
2005-11-17 17:46 ` [patch 05/22] USB: fix 'unused variable' warning Greg Kroah-Hartman
2005-11-17 17:46 ` [patch 04/22] USB: wacom tablet driver update Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 08/22] USB: usbdevfs_ioctl 32bit fix Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 07/22] usbfs: usbfs_dir_inode_operations cleanup Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 09/22] USB: kill unneccessary usb-storage blacklist entries Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 10/22] USB: cp2101.c: Jablotron usb serial interface identification Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 11/22] USB: onetouch doesn't suspend yet Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 12/22] USB: pl2303: adds new IDs Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 13/22] USB: pl2303: updates pl2303_update_line_status() Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 14/22] USB: Adapt microtek driver to new scsi features Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 16/22] USB: fix race in kaweth disconnect Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 17/22] usb devio warning fix Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 18/22] USB: Maxtor OneTouch button support for older drives Greg Kroah-Hartman
2005-11-17 17:47 ` [patch 19/22] USB: OHCI lh7a404 platform device conversion fixup Greg Kroah-Hartman
2005-11-17 17:48 ` [patch 15/22] usb-storage: Fix detection of kodak flash readers in shuttle_usbat driver Greg Kroah-Hartman
2005-11-17 17:48 ` Greg Kroah-Hartman [this message]
2005-11-17 17:48 ` [patch 20/22] USB: move CONFIG_USB_DEBUG checks into the Makefile Greg Kroah-Hartman
2005-11-17 17:48 ` [patch 21/22] USB: delete the nokia_dku2 driver Greg Kroah-Hartman
2005-11-17 17:48 ` [patch 22/22] USB: add the anydata usb-serial driver Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051117174805.GU11174@kroah.com \
--to=gregkh@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox