aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2014-07-17 16:32:26 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-17 20:05:07 -0400
commit256dbcd80f1ccf8abf421c1d72ba79a4e29941dd (patch)
treeae987790948d59a364fe7fec6dd14decf70c71a2
parent6f65126c76e38e671c64ec171acff8a99c4de749 (diff)
USB: OHCI: fix bugs in debug routines
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: Alan Stern <stern@rowland.harvard.edu> CC: <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/ohci-dbg.c9
-rw-r--r--drivers/usb/host/ohci-hcd.c10
2 files changed, 10 insertions, 9 deletions
diff --git a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
index 45032e933e18..04f2186939d2 100644
--- a/drivers/usb/host/ohci-dbg.c
+++ b/drivers/usb/host/ohci-dbg.c
@@ -236,7 +236,7 @@ ohci_dump_roothub (
236 } 236 }
237} 237}
238 238
239static void ohci_dump (struct ohci_hcd *controller, int verbose) 239static void ohci_dump(struct ohci_hcd *controller)
240{ 240{
241 ohci_dbg (controller, "OHCI controller state\n"); 241 ohci_dbg (controller, "OHCI controller state\n");
242 242
@@ -464,15 +464,16 @@ show_list (struct ohci_hcd *ohci, char *buf, size_t count, struct ed *ed)
464static ssize_t fill_async_buffer(struct debug_buffer *buf) 464static ssize_t fill_async_buffer(struct debug_buffer *buf)
465{ 465{
466 struct ohci_hcd *ohci; 466 struct ohci_hcd *ohci;
467 size_t temp; 467 size_t temp, size;
468 unsigned long flags; 468 unsigned long flags;
469 469
470 ohci = buf->ohci; 470 ohci = buf->ohci;
471 size = PAGE_SIZE;
471 472
472 /* display control and bulk lists together, for simplicity */ 473 /* display control and bulk lists together, for simplicity */
473 spin_lock_irqsave (&ohci->lock, flags); 474 spin_lock_irqsave (&ohci->lock, flags);
474 temp = show_list(ohci, buf->page, buf->count, ohci->ed_controltail); 475 temp = show_list(ohci, buf->page, size, ohci->ed_controltail);
475 temp += show_list(ohci, buf->page + temp, buf->count - temp, 476 temp += show_list(ohci, buf->page + temp, size - temp,
476 ohci->ed_bulktail); 477 ohci->ed_bulktail);
477 spin_unlock_irqrestore (&ohci->lock, flags); 478 spin_unlock_irqrestore (&ohci->lock, flags);
478 479
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 7f94c586c5dc..7570098b1cfa 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -76,8 +76,8 @@ static const char hcd_name [] = "ohci_hcd";
76#include "ohci.h" 76#include "ohci.h"
77#include "pci-quirks.h" 77#include "pci-quirks.h"
78 78
79static void ohci_dump (struct ohci_hcd *ohci, int verbose); 79static void ohci_dump(struct ohci_hcd *ohci);
80static void ohci_stop (struct usb_hcd *hcd); 80static void ohci_stop(struct usb_hcd *hcd);
81 81
82#include "ohci-hub.c" 82#include "ohci-hub.c"
83#include "ohci-dbg.c" 83#include "ohci-dbg.c"
@@ -770,7 +770,7 @@ retry:
770 ohci->ed_to_check = NULL; 770 ohci->ed_to_check = NULL;
771 } 771 }
772 772
773 ohci_dump (ohci, 1); 773 ohci_dump(ohci);
774 774
775 return 0; 775 return 0;
776} 776}
@@ -851,7 +851,7 @@ static irqreturn_t ohci_irq (struct usb_hcd *hcd)
851 usb_hc_died(hcd); 851 usb_hc_died(hcd);
852 } 852 }
853 853
854 ohci_dump (ohci, 1); 854 ohci_dump(ohci);
855 ohci_usb_reset (ohci); 855 ohci_usb_reset (ohci);
856 } 856 }
857 857
@@ -951,7 +951,7 @@ static void ohci_stop (struct usb_hcd *hcd)
951{ 951{
952 struct ohci_hcd *ohci = hcd_to_ohci (hcd); 952 struct ohci_hcd *ohci = hcd_to_ohci (hcd);
953 953
954 ohci_dump (ohci, 1); 954 ohci_dump(ohci);
955 955
956 if (quirk_nec(ohci)) 956 if (quirk_nec(ohci))
957 flush_work(&ohci->nec_work); 957 flush_work(&ohci->nec_work);