]> Pileus Git - ~andy/linux/commitdiff
ohci: remove conditional compilation
authorOliver Neukum <oneukum@suse.de>
Mon, 18 Nov 2013 12:22:57 +0000 (13:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2013 18:25:22 +0000 (10:25 -0800)
Conditional compilation for debugging is removed in favor of
dynamic debugging. To do so

1. the support for debugfs is always compiled
2. the support for the ancient print_urb debugging aid is removed

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-dbg.c
drivers/usb/host/ohci-hcd.c
drivers/usb/host/ohci-q.c
drivers/usb/host/ohci.h

index 3fca52ec02ac0b2d0859e96699958030938fce06..45032e933e18406b27897ad0b109ff4816e0b8c2 100644 (file)
@@ -9,8 +9,6 @@
 
 /*-------------------------------------------------------------------------*/
 
-#ifdef DEBUG
-
 #define edstring(ed_type) ({ char *temp; \
        switch (ed_type) { \
        case PIPE_CONTROL:      temp = "ctrl"; break; \
        } temp;})
 #define pipestring(pipe) edstring(usb_pipetype(pipe))
 
-/* debug| print the main components of an URB
- * small: 0) header + data packets 1) just header
- */
-static void __maybe_unused
-urb_print(struct urb * urb, char * str, int small, int status)
-{
-       unsigned int pipe= urb->pipe;
-
-       if (!urb->dev || !urb->dev->bus) {
-               printk(KERN_DEBUG "%s URB: no dev\n", str);
-               return;
-       }
-
-#ifndef        OHCI_VERBOSE_DEBUG
-       if (status != 0)
-#endif
-       printk(KERN_DEBUG "%s %p dev=%d ep=%d%s-%s flags=%x len=%d/%d stat=%d\n",
-                   str,
-                   urb,
-                   usb_pipedevice (pipe),
-                   usb_pipeendpoint (pipe),
-                   usb_pipeout (pipe)? "out" : "in",
-                   pipestring (pipe),
-                   urb->transfer_flags,
-                   urb->actual_length,
-                   urb->transfer_buffer_length,
-                   status);
-
-#ifdef OHCI_VERBOSE_DEBUG
-       if (!small) {
-               int i, len;
-
-               if (usb_pipecontrol (pipe)) {
-                       printk (KERN_DEBUG "%s: setup(8):", __FILE__);
-                       for (i = 0; i < 8 ; i++)
-                               printk (" %02x", ((__u8 *) urb->setup_packet) [i]);
-                       printk ("\n");
-               }
-               if (urb->transfer_buffer_length > 0 && urb->transfer_buffer) {
-                       printk (KERN_DEBUG "%s: data(%d/%d):", __FILE__,
-                               urb->actual_length,
-                               urb->transfer_buffer_length);
-                       len = usb_pipeout (pipe)?
-                                               urb->transfer_buffer_length: urb->actual_length;
-                       for (i = 0; i < 16 && i < len; i++)
-                               printk (" %02x", ((__u8 *) urb->transfer_buffer) [i]);
-                       printk ("%s stat:%d\n", i < len? "...": "", status);
-               }
-       }
-#endif
-}
 
 #define ohci_dbg_sw(ohci, next, size, format, arg...) \
        do { \
@@ -407,22 +354,8 @@ ohci_dump_ed (const struct ohci_hcd *ohci, const char *label,
        }
 }
 
-#else
-static inline void ohci_dump (struct ohci_hcd *controller, int verbose) {}
-
-#undef OHCI_VERBOSE_DEBUG
-
-#endif /* DEBUG */
-
 /*-------------------------------------------------------------------------*/
 
-#ifdef STUB_DEBUG_FILES
-
-static inline void create_debug_files (struct ohci_hcd *bus) { }
-static inline void remove_debug_files (struct ohci_hcd *bus) { }
-
-#else
-
 static int debug_async_open(struct inode *, struct file *);
 static int debug_periodic_open(struct inode *, struct file *);
 static int debug_registers_open(struct inode *, struct file *);
@@ -871,7 +804,5 @@ static inline void remove_debug_files (struct ohci_hcd *ohci)
        debugfs_remove(ohci->debug_dir);
 }
 
-#endif
-
 /*-------------------------------------------------------------------------*/
 
index 8ada13f8dde2c7350977cf343987fbb14c2f303b..e1c68094508d547e8467acb6fe42f5ed456d3fc3 100644 (file)
@@ -127,10 +127,6 @@ static int ohci_urb_enqueue (
        unsigned long   flags;
        int             retval = 0;
 
-#ifdef OHCI_VERBOSE_DEBUG
-       urb_print(urb, "SUB", usb_pipein(pipe), -EINPROGRESS);
-#endif
-
        /* every endpoint has a ed, locate and maybe (re)initialize it */
        if (! (ed = ed_get (ohci, urb->ep, urb->dev, pipe, urb->interval)))
                return -ENOMEM;
@@ -284,10 +280,6 @@ static int ohci_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
        unsigned long           flags;
        int                     rc;
 
-#ifdef OHCI_VERBOSE_DEBUG
-       urb_print(urb, "UNLINK", 1, status);
-#endif
-
        spin_lock_irqsave (&ohci->lock, flags);
        rc = usb_hcd_check_unlink_urb(hcd, urb, status);
        if (rc) {
index e7f577e636240b25a74f6b5f4b43c9ebdc99e9de..182eaa2183b1c27d5b389e2ad7aca3de97af6acc 100644 (file)
@@ -68,10 +68,6 @@ __acquires(ohci->lock)
                break;
        }
 
-#ifdef OHCI_VERBOSE_DEBUG
-       urb_print(urb, "RET", usb_pipeout (urb->pipe), status);
-#endif
-
        /* urb->complete() can reenter this HCD */
        usb_hcd_unlink_urb_from_ep(ohci_to_hcd(ohci), urb);
        spin_unlock (&ohci->lock);
index e2e5faa5a40249666626869f9e0b2d87502e325f..ea02722cab04e333880567a45d6f188990a15cd9 100644 (file)
@@ -415,12 +415,11 @@ struct ohci_hcd {
        struct ed               *ed_to_check;
        unsigned                zf_delay;
 
-#ifdef DEBUG
        struct dentry           *debug_dir;
        struct dentry           *debug_async;
        struct dentry           *debug_periodic;
        struct dentry           *debug_registers;
-#endif
+
        /* platform-specific data -- must come last */
        unsigned long           priv[0] __aligned(sizeof(s64));
 
@@ -474,10 +473,6 @@ static inline struct usb_hcd *ohci_to_hcd (const struct ohci_hcd *ohci)
 
 /*-------------------------------------------------------------------------*/
 
-#ifndef DEBUG
-#define STUB_DEBUG_FILES
-#endif /* DEBUG */
-
 #define ohci_dbg(ohci, fmt, args...) \
        dev_dbg (ohci_to_hcd(ohci)->self.controller , fmt , ## args )
 #define ohci_err(ohci, fmt, args...) \