Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: ehci-dbg: fix reading less content of periodic file

This patch fix 2 problems about reading periodic file:

1. The "..." after a interrupt qh is missed because buffer pointer is
not moved.

2. After setting p.ptr as NULL, its next qh or itd will be omited and
can't be stored in debug buffer.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Ming Lei and committed by
Greg Kroah-Hartman
3c4bb71f 3c04e20e

+5 -3
+5 -3
drivers/usb/host/ehci-dbg.c
··· 569 569 for (temp = 0; temp < seen_count; temp++) { 570 570 if (seen [temp].ptr != p.ptr) 571 571 continue; 572 - if (p.qh->qh_next.ptr) 572 + if (p.qh->qh_next.ptr) { 573 573 temp = scnprintf (next, size, 574 574 " ..."); 575 - p.ptr = NULL; 575 + size -= temp; 576 + next += temp; 577 + } 576 578 break; 577 579 } 578 580 /* show more info the first time around */ 579 - if (temp == seen_count && p.ptr) { 581 + if (temp == seen_count) { 580 582 u32 scratch = hc32_to_cpup(ehci, 581 583 &p.qh->hw_info1); 582 584 struct ehci_qtd *qtd;