Commit 668ab0db authored by Geyslan G. Bem's avatar Geyslan G. Bem Committed by Greg Kroah-Hartman

usb: host: ehci-dbg: remove space before open parenthesis

This patch fixes coding style issues reported by checkpatch. The vast
majority of changes in this patch are removing spaces before opening
parenthesis, but in some cases, a few additional changes are made to fix
other coding style issues.

These additional changes are:

 - Spaces around >> on line 50.
 - On line 55 a call to ehci_dbg reduced to a single line.
 - sizeof operands surrounded with parenthesis on lines 877, 883, 889
   and 901.
Signed-off-by: default avatarGeyslan G. Bem <geyslan@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4510a072
...@@ -24,41 +24,40 @@ ...@@ -24,41 +24,40 @@
* (host controller _Structural_ parameters) * (host controller _Structural_ parameters)
* see EHCI spec, Table 2-4 for each value * see EHCI spec, Table 2-4 for each value
*/ */
static void dbg_hcs_params (struct ehci_hcd *ehci, char *label) static void dbg_hcs_params(struct ehci_hcd *ehci, char *label)
{ {
u32 params = ehci_readl(ehci, &ehci->caps->hcs_params); u32 params = ehci_readl(ehci, &ehci->caps->hcs_params);
ehci_dbg (ehci, ehci_dbg(ehci,
"%s hcs_params 0x%x dbg=%d%s cc=%d pcc=%d%s%s ports=%d\n", "%s hcs_params 0x%x dbg=%d%s cc=%d pcc=%d%s%s ports=%d\n",
label, params, label, params,
HCS_DEBUG_PORT (params), HCS_DEBUG_PORT(params),
HCS_INDICATOR (params) ? " ind" : "", HCS_INDICATOR(params) ? " ind" : "",
HCS_N_CC (params), HCS_N_CC(params),
HCS_N_PCC (params), HCS_N_PCC(params),
HCS_PORTROUTED (params) ? "" : " ordered", HCS_PORTROUTED(params) ? "" : " ordered",
HCS_PPC (params) ? "" : " !ppc", HCS_PPC(params) ? "" : " !ppc",
HCS_N_PORTS (params) HCS_N_PORTS(params)
); );
/* Port routing, per EHCI 0.95 Spec, Section 2.2.5 */ /* Port routing, per EHCI 0.95 Spec, Section 2.2.5 */
if (HCS_PORTROUTED (params)) { if (HCS_PORTROUTED(params)) {
int i; int i;
char buf [46], tmp [7], byte; char buf [46], tmp [7], byte;
buf[0] = 0; buf[0] = 0;
for (i = 0; i < HCS_N_PORTS (params); i++) { for (i = 0; i < HCS_N_PORTS(params); i++) {
// FIXME MIPS won't readb() ... // FIXME MIPS won't readb() ...
byte = readb (&ehci->caps->portroute[(i>>1)]); byte = readb(&ehci->caps->portroute[(i >> 1)]);
sprintf(tmp, "%d ", sprintf(tmp, "%d ",
((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf))); ((i & 0x1) ? ((byte)&0xf) : ((byte>>4)&0xf)));
strcat(buf, tmp); strcat(buf, tmp);
} }
ehci_dbg (ehci, "%s portroute %s\n", ehci_dbg(ehci, "%s portroute %s\n", label, buf);
label, buf);
} }
} }
#else #else
static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {} static inline void dbg_hcs_params(struct ehci_hcd *ehci, char *label) {}
#endif #endif
...@@ -68,19 +67,19 @@ static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {} ...@@ -68,19 +67,19 @@ static inline void dbg_hcs_params (struct ehci_hcd *ehci, char *label) {}
* (host controller _Capability_ parameters) * (host controller _Capability_ parameters)
* see EHCI Spec, Table 2-5 for each value * see EHCI Spec, Table 2-5 for each value
* */ * */
static void dbg_hcc_params (struct ehci_hcd *ehci, char *label) static void dbg_hcc_params(struct ehci_hcd *ehci, char *label)
{ {
u32 params = ehci_readl(ehci, &ehci->caps->hcc_params); u32 params = ehci_readl(ehci, &ehci->caps->hcc_params);
if (HCC_ISOC_CACHE (params)) { if (HCC_ISOC_CACHE(params)) {
ehci_dbg (ehci, ehci_dbg(ehci,
"%s hcc_params %04x caching frame %s%s%s\n", "%s hcc_params %04x caching frame %s%s%s\n",
label, params, label, params,
HCC_PGM_FRAMELISTLEN(params) ? "256/512/1024" : "1024", HCC_PGM_FRAMELISTLEN(params) ? "256/512/1024" : "1024",
HCC_CANPARK(params) ? " park" : "", HCC_CANPARK(params) ? " park" : "",
HCC_64BIT_ADDR(params) ? " 64 bit addr" : ""); HCC_64BIT_ADDR(params) ? " 64 bit addr" : "");
} else { } else {
ehci_dbg (ehci, ehci_dbg(ehci,
"%s hcc_params %04x thresh %d uframes %s%s%s%s%s%s%s\n", "%s hcc_params %04x thresh %d uframes %s%s%s%s%s%s%s\n",
label, label,
params, params,
...@@ -97,14 +96,14 @@ static void dbg_hcc_params (struct ehci_hcd *ehci, char *label) ...@@ -97,14 +96,14 @@ static void dbg_hcc_params (struct ehci_hcd *ehci, char *label)
} }
#else #else
static inline void dbg_hcc_params (struct ehci_hcd *ehci, char *label) {} static inline void dbg_hcc_params(struct ehci_hcd *ehci, char *label) {}
#endif #endif
#ifdef CONFIG_DYNAMIC_DEBUG #ifdef CONFIG_DYNAMIC_DEBUG
static void __maybe_unused static void __maybe_unused
dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) dbg_qtd(const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
{ {
ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd, ehci_dbg(ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
hc32_to_cpup(ehci, &qtd->hw_next), hc32_to_cpup(ehci, &qtd->hw_next),
...@@ -120,22 +119,22 @@ dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd) ...@@ -120,22 +119,22 @@ dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
} }
static void __maybe_unused static void __maybe_unused
dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) dbg_qh(const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
{ {
struct ehci_qh_hw *hw = qh->hw; struct ehci_qh_hw *hw = qh->hw;
ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label, ehci_dbg(ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
qh, hw->hw_next, hw->hw_info1, hw->hw_info2, hw->hw_current); qh, hw->hw_next, hw->hw_info1, hw->hw_info2, hw->hw_current);
dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next); dbg_qtd("overlay", ehci, (struct ehci_qtd *) &hw->hw_qtd_next);
} }
static void __maybe_unused static void __maybe_unused
dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) dbg_itd(const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
{ {
ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n", ehci_dbg(ehci, "%s [%d] itd %p, next %08x, urb %p\n",
label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next), label, itd->frame, itd, hc32_to_cpu(ehci, itd->hw_next),
itd->urb); itd->urb);
ehci_dbg (ehci, ehci_dbg(ehci,
" trans: %08x %08x %08x %08x %08x %08x %08x %08x\n", " trans: %08x %08x %08x %08x %08x %08x %08x %08x\n",
hc32_to_cpu(ehci, itd->hw_transaction[0]), hc32_to_cpu(ehci, itd->hw_transaction[0]),
hc32_to_cpu(ehci, itd->hw_transaction[1]), hc32_to_cpu(ehci, itd->hw_transaction[1]),
...@@ -145,7 +144,7 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) ...@@ -145,7 +144,7 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
hc32_to_cpu(ehci, itd->hw_transaction[5]), hc32_to_cpu(ehci, itd->hw_transaction[5]),
hc32_to_cpu(ehci, itd->hw_transaction[6]), hc32_to_cpu(ehci, itd->hw_transaction[6]),
hc32_to_cpu(ehci, itd->hw_transaction[7])); hc32_to_cpu(ehci, itd->hw_transaction[7]));
ehci_dbg (ehci, ehci_dbg(ehci,
" buf: %08x %08x %08x %08x %08x %08x %08x\n", " buf: %08x %08x %08x %08x %08x %08x %08x\n",
hc32_to_cpu(ehci, itd->hw_bufp[0]), hc32_to_cpu(ehci, itd->hw_bufp[0]),
hc32_to_cpu(ehci, itd->hw_bufp[1]), hc32_to_cpu(ehci, itd->hw_bufp[1]),
...@@ -154,19 +153,19 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) ...@@ -154,19 +153,19 @@ dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd)
hc32_to_cpu(ehci, itd->hw_bufp[4]), hc32_to_cpu(ehci, itd->hw_bufp[4]),
hc32_to_cpu(ehci, itd->hw_bufp[5]), hc32_to_cpu(ehci, itd->hw_bufp[5]),
hc32_to_cpu(ehci, itd->hw_bufp[6])); hc32_to_cpu(ehci, itd->hw_bufp[6]));
ehci_dbg (ehci, " index: %d %d %d %d %d %d %d %d\n", ehci_dbg(ehci, " index: %d %d %d %d %d %d %d %d\n",
itd->index[0], itd->index[1], itd->index[2], itd->index[0], itd->index[1], itd->index[2],
itd->index[3], itd->index[4], itd->index[5], itd->index[3], itd->index[4], itd->index[5],
itd->index[6], itd->index[7]); itd->index[6], itd->index[7]);
} }
static void __maybe_unused static void __maybe_unused
dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) dbg_sitd(const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
{ {
ehci_dbg (ehci, "%s [%d] sitd %p, next %08x, urb %p\n", ehci_dbg(ehci, "%s [%d] sitd %p, next %08x, urb %p\n",
label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next), label, sitd->frame, sitd, hc32_to_cpu(ehci, sitd->hw_next),
sitd->urb); sitd->urb);
ehci_dbg (ehci, ehci_dbg(ehci,
" addr %08x sched %04x result %08x buf %08x %08x\n", " addr %08x sched %04x result %08x buf %08x %08x\n",
hc32_to_cpu(ehci, sitd->hw_fullspeed_ep), hc32_to_cpu(ehci, sitd->hw_fullspeed_ep),
hc32_to_cpu(ehci, sitd->hw_uframe), hc32_to_cpu(ehci, sitd->hw_uframe),
...@@ -176,9 +175,9 @@ dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) ...@@ -176,9 +175,9 @@ dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
} }
static int __maybe_unused static int __maybe_unused
dbg_status_buf (char *buf, unsigned len, const char *label, u32 status) dbg_status_buf(char *buf, unsigned len, const char *label, u32 status)
{ {
return scnprintf (buf, len, return scnprintf(buf, len,
"%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s%s", "%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s%s",
label, label [0] ? " " : "", status, label, label [0] ? " " : "", status,
(status & STS_PPCE_MASK) ? " PPCE" : "", (status & STS_PPCE_MASK) ? " PPCE" : "",
...@@ -196,9 +195,9 @@ dbg_status_buf (char *buf, unsigned len, const char *label, u32 status) ...@@ -196,9 +195,9 @@ dbg_status_buf (char *buf, unsigned len, const char *label, u32 status)
} }
static int __maybe_unused static int __maybe_unused
dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable) dbg_intr_buf(char *buf, unsigned len, const char *label, u32 enable)
{ {
return scnprintf (buf, len, return scnprintf(buf, len,
"%s%sintrenable %02x%s%s%s%s%s%s%s", "%s%sintrenable %02x%s%s%s%s%s%s%s",
label, label [0] ? " " : "", enable, label, label [0] ? " " : "", enable,
(enable & STS_PPCE_MASK) ? " PPCE" : "", (enable & STS_PPCE_MASK) ? " PPCE" : "",
...@@ -215,9 +214,9 @@ static const char *const fls_strings [] = ...@@ -215,9 +214,9 @@ static const char *const fls_strings [] =
{ "1024", "512", "256", "??" }; { "1024", "512", "256", "??" };
static int static int
dbg_command_buf (char *buf, unsigned len, const char *label, u32 command) dbg_command_buf(char *buf, unsigned len, const char *label, u32 command)
{ {
return scnprintf (buf, len, return scnprintf(buf, len,
"%s%scommand %07x %s%s%s%s%s%s=%d ithresh=%d%s%s%s%s " "%s%scommand %07x %s%s%s%s%s%s=%d ithresh=%d%s%s%s%s "
"period=%s%s %s", "period=%s%s %s",
label, label [0] ? " " : "", command, label, label [0] ? " " : "", command,
...@@ -227,7 +226,7 @@ dbg_command_buf (char *buf, unsigned len, const char *label, u32 command) ...@@ -227,7 +226,7 @@ dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
(command & CMD_ASPE) ? " ASPE" : "", (command & CMD_ASPE) ? " ASPE" : "",
(command & CMD_PSPE) ? " PSPE" : "", (command & CMD_PSPE) ? " PSPE" : "",
(command & CMD_PARK) ? " park" : "(park)", (command & CMD_PARK) ? " park" : "(park)",
CMD_PARK_CNT (command), CMD_PARK_CNT(command),
(command >> 16) & 0x3f, (command >> 16) & 0x3f,
(command & CMD_LRESET) ? " LReset" : "", (command & CMD_LRESET) ? " LReset" : "",
(command & CMD_IAAD) ? " IAAD" : "", (command & CMD_IAAD) ? " IAAD" : "",
...@@ -240,7 +239,7 @@ dbg_command_buf (char *buf, unsigned len, const char *label, u32 command) ...@@ -240,7 +239,7 @@ dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
} }
static int static int
dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status) dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status)
{ {
char *sig; char *sig;
...@@ -252,7 +251,7 @@ dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status) ...@@ -252,7 +251,7 @@ dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
default: sig = "?"; break; default: sig = "?"; break;
} }
return scnprintf (buf, len, return scnprintf(buf, len,
"%s%sport:%d status %06x %d %s%s%s%s%s%s " "%s%sport:%d status %06x %d %s%s%s%s%s%s "
"sig=%s%s%s%s%s%s%s%s%s%s%s", "sig=%s%s%s%s%s%s%s%s%s%s%s",
label, label [0] ? " " : "", port, status, label, label [0] ? " " : "", port, status,
...@@ -282,23 +281,23 @@ dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status) ...@@ -282,23 +281,23 @@ dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
#else #else
static inline void __maybe_unused static inline void __maybe_unused
dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) dbg_qh(char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
{} {}
static inline int __maybe_unused static inline int __maybe_unused
dbg_status_buf (char *buf, unsigned len, const char *label, u32 status) dbg_status_buf(char *buf, unsigned len, const char *label, u32 status)
{ return 0; } { return 0; }
static inline int __maybe_unused static inline int __maybe_unused
dbg_command_buf (char *buf, unsigned len, const char *label, u32 command) dbg_command_buf(char *buf, unsigned len, const char *label, u32 command)
{ return 0; } { return 0; }
static inline int __maybe_unused static inline int __maybe_unused
dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable) dbg_intr_buf(char *buf, unsigned len, const char *label, u32 enable)
{ return 0; } { return 0; }
static inline int __maybe_unused static inline int __maybe_unused
dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status) dbg_port_buf(char *buf, unsigned len, const char *label, int port, u32 status)
{ return 0; } { return 0; }
#endif /* CONFIG_DYNAMIC_DEBUG */ #endif /* CONFIG_DYNAMIC_DEBUG */
...@@ -326,8 +325,8 @@ dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status) ...@@ -326,8 +325,8 @@ dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
#ifdef STUB_DEBUG_FILES #ifdef STUB_DEBUG_FILES
static inline void create_debug_files (struct ehci_hcd *bus) { } static inline void create_debug_files(struct ehci_hcd *bus) { }
static inline void remove_debug_files (struct ehci_hcd *bus) { } static inline void remove_debug_files(struct ehci_hcd *bus) { }
#else #else
...@@ -397,13 +396,13 @@ static inline char token_mark(struct ehci_hcd *ehci, __hc32 token) ...@@ -397,13 +396,13 @@ static inline char token_mark(struct ehci_hcd *ehci, __hc32 token)
return '*'; return '*';
if (v & QTD_STS_HALT) if (v & QTD_STS_HALT)
return '-'; return '-';
if (!IS_SHORT_READ (v)) if (!IS_SHORT_READ(v))
return ' '; return ' ';
/* tries to advance through hw_alt_next */ /* tries to advance through hw_alt_next */
return '/'; return '/';
} }
static void qh_lines ( static void qh_lines(
struct ehci_hcd *ehci, struct ehci_hcd *ehci,
struct ehci_qh *qh, struct ehci_qh *qh,
char **nextp, char **nextp,
...@@ -435,7 +434,7 @@ static void qh_lines ( ...@@ -435,7 +434,7 @@ static void qh_lines (
} }
scratch = hc32_to_cpup(ehci, &hw->hw_info1); scratch = hc32_to_cpup(ehci, &hw->hw_info1);
hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0; hw_curr = (mark == '*') ? hc32_to_cpup(ehci, &hw->hw_current) : 0;
temp = scnprintf (next, size, temp = scnprintf(next, size,
"qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)" "qh/%p dev%d %cs ep%d %08x %08x (%08x%c %s nak%d)"
" [cur %08x next %08x buf[0] %08x]", " [cur %08x next %08x buf[0] %08x]",
qh, scratch & 0x007f, qh, scratch & 0x007f,
...@@ -453,21 +452,21 @@ static void qh_lines ( ...@@ -453,21 +452,21 @@ static void qh_lines (
next += temp; next += temp;
/* hc may be modifying the list as we read it ... */ /* hc may be modifying the list as we read it ... */
list_for_each (entry, &qh->qtd_list) { list_for_each(entry, &qh->qtd_list) {
td = list_entry (entry, struct ehci_qtd, qtd_list); td = list_entry(entry, struct ehci_qtd, qtd_list);
scratch = hc32_to_cpup(ehci, &td->hw_token); scratch = hc32_to_cpup(ehci, &td->hw_token);
mark = ' '; mark = ' ';
if (hw_curr == td->qtd_dma) if (hw_curr == td->qtd_dma)
mark = '*'; mark = '*';
else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma)) else if (hw->hw_qtd_next == cpu_to_hc32(ehci, td->qtd_dma))
mark = '+'; mark = '+';
else if (QTD_LENGTH (scratch)) { else if (QTD_LENGTH(scratch)) {
if (td->hw_alt_next == ehci->async->hw->hw_alt_next) if (td->hw_alt_next == ehci->async->hw->hw_alt_next)
mark = '#'; mark = '#';
else if (td->hw_alt_next != list_end) else if (td->hw_alt_next != list_end)
mark = '/'; mark = '/';
} }
temp = snprintf (next, size, temp = snprintf(next, size,
"\n\t%p%c%s len=%d %08x urb %p" "\n\t%p%c%s len=%d %08x urb %p"
" [td %08x buf[0] %08x]", " [td %08x buf[0] %08x]",
td, mark, ({ char *tmp; td, mark, ({ char *tmp;
...@@ -490,7 +489,7 @@ static void qh_lines ( ...@@ -490,7 +489,7 @@ static void qh_lines (
goto done; goto done;
} }
temp = snprintf (next, size, "\n"); temp = snprintf(next, size, "\n");
if (size < temp) if (size < temp)
temp = size; temp = size;
size -= temp; size -= temp;
...@@ -511,7 +510,7 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf) ...@@ -511,7 +510,7 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)
struct ehci_qh *qh; struct ehci_qh *qh;
hcd = bus_to_hcd(buf->bus); hcd = bus_to_hcd(buf->bus);
ehci = hcd_to_ehci (hcd); ehci = hcd_to_ehci(hcd);
next = buf->output_buf; next = buf->output_buf;
size = buf->alloc_size; size = buf->alloc_size;
...@@ -521,9 +520,9 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf) ...@@ -521,9 +520,9 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)
* usually empty except for long-term bulk reads, or head. * usually empty except for long-term bulk reads, or head.
* one QH per line, and TDs we know about * one QH per line, and TDs we know about
*/ */
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh) for (qh = ehci->async->qh_next.qh; size > 0 && qh; qh = qh->qh_next.qh)
qh_lines (ehci, qh, &next, &size); qh_lines(ehci, qh, &next, &size);
if (!list_empty(&ehci->async_unlink) && size > 0) { if (!list_empty(&ehci->async_unlink) && size > 0) {
temp = scnprintf(next, size, "\nunlink =\n"); temp = scnprintf(next, size, "\nunlink =\n");
size -= temp; size -= temp;
...@@ -535,7 +534,7 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf) ...@@ -535,7 +534,7 @@ static ssize_t fill_async_buffer(struct debug_buffer *buf)
qh_lines(ehci, qh, &next, &size); qh_lines(ehci, qh, &next, &size);
} }
} }
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
return strlen(buf->output_buf); return strlen(buf->output_buf);
} }
...@@ -641,25 +640,25 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -641,25 +640,25 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
seen_count = 0; seen_count = 0;
hcd = bus_to_hcd(buf->bus); hcd = bus_to_hcd(buf->bus);
ehci = hcd_to_ehci (hcd); ehci = hcd_to_ehci(hcd);
next = buf->output_buf; next = buf->output_buf;
size = buf->alloc_size; size = buf->alloc_size;
temp = scnprintf (next, size, "size = %d\n", ehci->periodic_size); temp = scnprintf(next, size, "size = %d\n", ehci->periodic_size);
size -= temp; size -= temp;
next += temp; next += temp;
/* dump a snapshot of the periodic schedule. /* dump a snapshot of the periodic schedule.
* iso changes, interrupt usually doesn't. * iso changes, interrupt usually doesn't.
*/ */
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
for (i = 0; i < ehci->periodic_size; i++) { for (i = 0; i < ehci->periodic_size; i++) {
p = ehci->pshadow [i]; p = ehci->pshadow [i];
if (likely (!p.ptr)) if (likely(!p.ptr))
continue; continue;
tag = Q_NEXT_TYPE(ehci, ehci->periodic [i]); tag = Q_NEXT_TYPE(ehci, ehci->periodic [i]);
temp = scnprintf (next, size, "%4d: ", i); temp = scnprintf(next, size, "%4d: ", i);
size -= temp; size -= temp;
next += temp; next += temp;
...@@ -669,7 +668,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -669,7 +668,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
switch (hc32_to_cpu(ehci, tag)) { switch (hc32_to_cpu(ehci, tag)) {
case Q_TYPE_QH: case Q_TYPE_QH:
hw = p.qh->hw; hw = p.qh->hw;
temp = scnprintf (next, size, " qh%d-%04x/%p", temp = scnprintf(next, size, " qh%d-%04x/%p",
p.qh->ps.period, p.qh->ps.period,
hc32_to_cpup(ehci, hc32_to_cpup(ehci,
&hw->hw_info2) &hw->hw_info2)
...@@ -683,7 +682,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -683,7 +682,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
if (seen [temp].ptr != p.ptr) if (seen [temp].ptr != p.ptr)
continue; continue;
if (p.qh->qh_next.ptr) { if (p.qh->qh_next.ptr) {
temp = scnprintf (next, size, temp = scnprintf(next, size,
" ..."); " ...");
size -= temp; size -= temp;
next += temp; next += temp;
...@@ -699,7 +698,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -699,7 +698,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
/* count tds, get ep direction */ /* count tds, get ep direction */
temp = 0; temp = 0;
list_for_each_entry (qtd, list_for_each_entry(qtd,
&p.qh->qtd_list, &p.qh->qtd_list,
qtd_list) { qtd_list) {
temp++; temp++;
...@@ -711,7 +710,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -711,7 +710,7 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
} }
} }
temp = scnprintf (next, size, temp = scnprintf(next, size,
" (%c%d ep%d%s " " (%c%d ep%d%s "
"[%d/%d] q%d p%d)", "[%d/%d] q%d p%d)",
speed_char (scratch), speed_char (scratch),
...@@ -730,20 +729,20 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -730,20 +729,20 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
p = p.qh->qh_next; p = p.qh->qh_next;
break; break;
case Q_TYPE_FSTN: case Q_TYPE_FSTN:
temp = scnprintf (next, size, temp = scnprintf(next, size,
" fstn-%8x/%p", p.fstn->hw_prev, " fstn-%8x/%p", p.fstn->hw_prev,
p.fstn); p.fstn);
tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next); tag = Q_NEXT_TYPE(ehci, p.fstn->hw_next);
p = p.fstn->fstn_next; p = p.fstn->fstn_next;
break; break;
case Q_TYPE_ITD: case Q_TYPE_ITD:
temp = scnprintf (next, size, temp = scnprintf(next, size,
" itd/%p", p.itd); " itd/%p", p.itd);
tag = Q_NEXT_TYPE(ehci, p.itd->hw_next); tag = Q_NEXT_TYPE(ehci, p.itd->hw_next);
p = p.itd->itd_next; p = p.itd->itd_next;
break; break;
case Q_TYPE_SITD: case Q_TYPE_SITD:
temp = scnprintf (next, size, temp = scnprintf(next, size,
" sitd%d-%04x/%p", " sitd%d-%04x/%p",
p.sitd->stream->ps.period, p.sitd->stream->ps.period,
hc32_to_cpup(ehci, &p.sitd->hw_uframe) hc32_to_cpup(ehci, &p.sitd->hw_uframe)
...@@ -757,12 +756,12 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf) ...@@ -757,12 +756,12 @@ static ssize_t fill_periodic_buffer(struct debug_buffer *buf)
next += temp; next += temp;
} while (p.ptr); } while (p.ptr);
temp = scnprintf (next, size, "\n"); temp = scnprintf(next, size, "\n");
size -= temp; size -= temp;
next += temp; next += temp;
} }
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
kfree (seen); kfree(seen);
return buf->alloc_size - size; return buf->alloc_size - size;
} }
...@@ -794,14 +793,14 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) ...@@ -794,14 +793,14 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
static char label [] = ""; static char label [] = "";
hcd = bus_to_hcd(buf->bus); hcd = bus_to_hcd(buf->bus);
ehci = hcd_to_ehci (hcd); ehci = hcd_to_ehci(hcd);
next = buf->output_buf; next = buf->output_buf;
size = buf->alloc_size; size = buf->alloc_size;
spin_lock_irqsave (&ehci->lock, flags); spin_lock_irqsave(&ehci->lock, flags);
if (!HCD_HW_ACCESSIBLE(hcd)) { if (!HCD_HW_ACCESSIBLE(hcd)) {
size = scnprintf (next, size, size = scnprintf(next, size,
"bus %s, device %s\n" "bus %s, device %s\n"
"%s\n" "%s\n"
"SUSPENDED (no register access)\n", "SUSPENDED (no register access)\n",
...@@ -813,7 +812,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) ...@@ -813,7 +812,7 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
/* Capability Registers */ /* Capability Registers */
i = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase)); i = HC_VERSION(ehci, ehci_readl(ehci, &ehci->caps->hc_capbase));
temp = scnprintf (next, size, temp = scnprintf(next, size,
"bus %s, device %s\n" "bus %s, device %s\n"
"%s\n" "%s\n"
"EHCI %x.%02x, rh state %s\n", "EHCI %x.%02x, rh state %s\n",
...@@ -835,10 +834,10 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) ...@@ -835,10 +834,10 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
offset = HCC_EXT_CAPS(ehci_readl(ehci, offset = HCC_EXT_CAPS(ehci_readl(ehci,
&ehci->caps->hcc_params)); &ehci->caps->hcc_params));
while (offset && count--) { while (offset && count--) {
pci_read_config_dword (pdev, offset, &cap); pci_read_config_dword(pdev, offset, &cap);
switch (cap & 0xff) { switch (cap & 0xff) {
case 1: case 1:
temp = scnprintf (next, size, temp = scnprintf(next, size,
"ownership %08x%s%s\n", cap, "ownership %08x%s%s\n", cap,
(cap & (1 << 24)) ? " linux" : "", (cap & (1 << 24)) ? " linux" : "",
(cap & (1 << 16)) ? " firmware" : ""); (cap & (1 << 16)) ? " firmware" : "");
...@@ -846,8 +845,8 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) ...@@ -846,8 +845,8 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
next += temp; next += temp;
offset += 4; offset += 4;
pci_read_config_dword (pdev, offset, &cap2); pci_read_config_dword(pdev, offset, &cap2);
temp = scnprintf (next, size, temp = scnprintf(next, size,
"SMI sts/enable 0x%08x\n", cap2); "SMI sts/enable 0x%08x\n", cap2);
size -= temp; size -= temp;
next += temp; next += temp;
...@@ -865,48 +864,48 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) ...@@ -865,48 +864,48 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
// FIXME interpret both types of params // FIXME interpret both types of params
i = ehci_readl(ehci, &ehci->caps->hcs_params); i = ehci_readl(ehci, &ehci->caps->hcs_params);
temp = scnprintf (next, size, "structural params 0x%08x\n", i); temp = scnprintf(next, size, "structural params 0x%08x\n", i);
size -= temp; size -= temp;
next += temp; next += temp;
i = ehci_readl(ehci, &ehci->caps->hcc_params); i = ehci_readl(ehci, &ehci->caps->hcc_params);
temp = scnprintf (next, size, "capability params 0x%08x\n", i); temp = scnprintf(next, size, "capability params 0x%08x\n", i);
size -= temp; size -= temp;
next += temp; next += temp;
/* Operational Registers */ /* Operational Registers */
temp = dbg_status_buf (scratch, sizeof scratch, label, temp = dbg_status_buf(scratch, sizeof(scratch), label,
ehci_readl(ehci, &ehci->regs->status)); ehci_readl(ehci, &ehci->regs->status));
temp = scnprintf (next, size, fmt, temp, scratch); temp = scnprintf(next, size, fmt, temp, scratch);
size -= temp; size -= temp;
next += temp; next += temp;
temp = dbg_command_buf (scratch, sizeof scratch, label, temp = dbg_command_buf(scratch, sizeof(scratch), label,
ehci_readl(ehci, &ehci->regs->command)); ehci_readl(ehci, &ehci->regs->command));
temp = scnprintf (next, size, fmt, temp, scratch); temp = scnprintf(next, size, fmt, temp, scratch);
size -= temp; size -= temp;
next += temp; next += temp;
temp = dbg_intr_buf (scratch, sizeof scratch, label, temp = dbg_intr_buf(scratch, sizeof(scratch), label,
ehci_readl(ehci, &ehci->regs->intr_enable)); ehci_readl(ehci, &ehci->regs->intr_enable));
temp = scnprintf (next, size, fmt, temp, scratch); temp = scnprintf(next, size, fmt, temp, scratch);
size -= temp; size -= temp;
next += temp; next += temp;
temp = scnprintf (next, size, "uframe %04x\n", temp = scnprintf(next, size, "uframe %04x\n",
ehci_read_frame_index(ehci)); ehci_read_frame_index(ehci));
size -= temp; size -= temp;
next += temp; next += temp;
for (i = 1; i <= HCS_N_PORTS (ehci->hcs_params); i++) { for (i = 1; i <= HCS_N_PORTS(ehci->hcs_params); i++) {
temp = dbg_port_buf (scratch, sizeof scratch, label, i, temp = dbg_port_buf(scratch, sizeof(scratch), label, i,
ehci_readl(ehci, ehci_readl(ehci,
&ehci->regs->port_status[i - 1])); &ehci->regs->port_status[i - 1]));
temp = scnprintf (next, size, fmt, temp, scratch); temp = scnprintf(next, size, fmt, temp, scratch);
size -= temp; size -= temp;
next += temp; next += temp;
if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) { if (i == HCS_DEBUG_PORT(ehci->hcs_params) && ehci->debug) {
temp = scnprintf (next, size, temp = scnprintf(next, size,
" debug control %08x\n", " debug control %08x\n",
ehci_readl(ehci, ehci_readl(ehci,
&ehci->debug->control)); &ehci->debug->control));
...@@ -924,21 +923,21 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf) ...@@ -924,21 +923,21 @@ static ssize_t fill_registers_buffer(struct debug_buffer *buf)
} }
#ifdef EHCI_STATS #ifdef EHCI_STATS
temp = scnprintf (next, size, temp = scnprintf(next, size,
"irq normal %ld err %ld iaa %ld (lost %ld)\n", "irq normal %ld err %ld iaa %ld (lost %ld)\n",
ehci->stats.normal, ehci->stats.error, ehci->stats.iaa, ehci->stats.normal, ehci->stats.error, ehci->stats.iaa,
ehci->stats.lost_iaa); ehci->stats.lost_iaa);
size -= temp; size -= temp;
next += temp; next += temp;
temp = scnprintf (next, size, "complete %ld unlink %ld\n", temp = scnprintf(next, size, "complete %ld unlink %ld\n",
ehci->stats.complete, ehci->stats.unlink); ehci->stats.complete, ehci->stats.unlink);
size -= temp; size -= temp;
next += temp; next += temp;
#endif #endif
done: done:
spin_unlock_irqrestore (&ehci->lock, flags); spin_unlock_irqrestore(&ehci->lock, flags);
return buf->alloc_size - size; return buf->alloc_size - size;
} }
...@@ -1054,7 +1053,7 @@ static int debug_registers_open(struct inode *inode, struct file *file) ...@@ -1054,7 +1053,7 @@ static int debug_registers_open(struct inode *inode, struct file *file)
return file->private_data ? 0 : -ENOMEM; return file->private_data ? 0 : -ENOMEM;
} }
static inline void create_debug_files (struct ehci_hcd *ehci) static inline void create_debug_files(struct ehci_hcd *ehci)
{ {
struct usb_bus *bus = &ehci_to_hcd(ehci)->self; struct usb_bus *bus = &ehci_to_hcd(ehci)->self;
...@@ -1084,7 +1083,7 @@ static inline void create_debug_files (struct ehci_hcd *ehci) ...@@ -1084,7 +1083,7 @@ static inline void create_debug_files (struct ehci_hcd *ehci)
debugfs_remove_recursive(ehci->debug_dir); debugfs_remove_recursive(ehci->debug_dir);
} }
static inline void remove_debug_files (struct ehci_hcd *ehci) static inline void remove_debug_files(struct ehci_hcd *ehci)
{ {
debugfs_remove_recursive(ehci->debug_dir); debugfs_remove_recursive(ehci->debug_dir);
} }
......
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