Commit 6a04d05a authored by Alan Stern's avatar Alan Stern Committed by Jiri Slaby

USB: OHCI: fix bugs in debug routines

commit 256dbcd8 upstream.

The debug routine fill_async_buffer() in ohci-hcd is buggy: It never
produces any output because it forgets to initialize the output buffer
size.  Also, the debug routine ohci_dump() has an unused argument.

This patch adds the correct initialization and removes the unused
argument.
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent e4ca8b78
...@@ -289,7 +289,7 @@ ohci_dump_roothub ( ...@@ -289,7 +289,7 @@ ohci_dump_roothub (
} }
} }
static void ohci_dump (struct ohci_hcd *controller, int verbose) static void ohci_dump(struct ohci_hcd *controller)
{ {
ohci_dbg (controller, "OHCI controller state\n"); ohci_dbg (controller, "OHCI controller state\n");
...@@ -408,7 +408,7 @@ ohci_dump_ed (const struct ohci_hcd *ohci, const char *label, ...@@ -408,7 +408,7 @@ ohci_dump_ed (const struct ohci_hcd *ohci, const char *label,
} }
#else #else
static inline void ohci_dump (struct ohci_hcd *controller, int verbose) {} static inline void ohci_dump (struct ohci_hcd *controller) {}
#undef OHCI_VERBOSE_DEBUG #undef OHCI_VERBOSE_DEBUG
...@@ -531,15 +531,16 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed) ...@@ -531,15 +531,16 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)
static ssize_t fill_async_buffer(struct debug_buffer *buf) static ssize_t fill_async_buffer(struct debug_buffer *buf)
{ {
struct ohci_hcd *ohci; struct ohci_hcd *ohci;
size_t temp; size_t temp, size;
unsigned long flags; unsigned long flags;
ohci = buf->ohci; ohci = buf->ohci;
size = PAGE_SIZE;
/* display control and bulk lists together, for simplicity */ /* display control and bulk lists together, for simplicity */
spin_lock_irqsave (&ohci->lock, flags); spin_lock_irqsave (&ohci->lock, flags);
temp = show_list(ohci, buf->page, buf->count, ohci->ed_controltail); temp = show_list(ohci, buf->page, size, ohci->ed_controltail);
temp += show_list(ohci, buf->page + temp, buf->count - temp, temp += show_list(ohci, buf->page + temp, size - temp,
ohci->ed_bulktail); ohci->ed_bulktail);
spin_unlock_irqrestore (&ohci->lock, flags); spin_unlock_irqrestore (&ohci->lock, flags);
......
...@@ -78,8 +78,8 @@ static const char hcd_name [] = "ohci_hcd"; ...@@ -78,8 +78,8 @@ static const char hcd_name [] = "ohci_hcd";
#include "ohci.h" #include "ohci.h"
#include "pci-quirks.h" #include "pci-quirks.h"
static void ohci_dump (struct ohci_hcd *ohci, int verbose); static void ohci_dump(struct ohci_hcd *ohci);
static void ohci_stop (struct usb_hcd *hcd); static void ohci_stop(struct usb_hcd *hcd);
#include "ohci-hub.c" #include "ohci-hub.c"
#include "ohci-dbg.c" #include "ohci-dbg.c"
...@@ -754,7 +754,7 @@ static int ohci_run (struct ohci_hcd *ohci) ...@@ -754,7 +754,7 @@ static int ohci_run (struct ohci_hcd *ohci)
ohci->ed_to_check = NULL; ohci->ed_to_check = NULL;
} }
ohci_dump (ohci, 1); ohci_dump(ohci);
return 0; return 0;
} }
...@@ -835,7 +835,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd) ...@@ -835,7 +835,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
usb_hc_died(hcd); usb_hc_died(hcd);
} }
ohci_dump (ohci, 1); ohci_dump(ohci);
ohci_usb_reset (ohci); ohci_usb_reset (ohci);
} }
...@@ -935,7 +935,7 @@ static void ohci_stop (struct usb_hcd *hcd) ...@@ -935,7 +935,7 @@ static void ohci_stop (struct usb_hcd *hcd)
{ {
struct ohci_hcd *ohci = hcd_to_ohci (hcd); struct ohci_hcd *ohci = hcd_to_ohci (hcd);
ohci_dump (ohci, 1); ohci_dump(ohci);
if (quirk_nec(ohci)) if (quirk_nec(ohci))
flush_work(&ohci->nec_work); flush_work(&ohci->nec_work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment