Commit a45aa13b authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB ehci: minor debug cleanups

This updates debug messages, declaring that labels can be constant strings
and changing some old-school dbg() calls to driver model dev_dbg().
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 6b21c2c6
...@@ -185,7 +185,7 @@ dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd) ...@@ -185,7 +185,7 @@ dbg_sitd (const char *label, struct ehci_hcd *ehci, struct ehci_sitd *sitd)
} }
static int __attribute__((__unused__)) static int __attribute__((__unused__))
dbg_status_buf (char *buf, unsigned len, 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%sstatus %04x%s%s%s%s%s%s%s%s%s%s",
...@@ -204,7 +204,7 @@ dbg_status_buf (char *buf, unsigned len, char *label, u32 status) ...@@ -204,7 +204,7 @@ dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
} }
static int __attribute__((__unused__)) static int __attribute__((__unused__))
dbg_intr_buf (char *buf, unsigned len, 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%sintrenable %02x%s%s%s%s%s%s",
...@@ -221,7 +221,8 @@ dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable) ...@@ -221,7 +221,8 @@ dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable)
static const char *const fls_strings [] = static const char *const fls_strings [] =
{ "1024", "512", "256", "??" }; { "1024", "512", "256", "??" };
static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command) static int
dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
{ {
return scnprintf (buf, len, return scnprintf (buf, len,
"%s%scommand %06x %s=%d ithresh=%d%s%s%s%s period=%s%s %s", "%s%scommand %06x %s=%d ithresh=%d%s%s%s%s period=%s%s %s",
...@@ -240,7 +241,7 @@ static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command) ...@@ -240,7 +241,7 @@ static int dbg_command_buf (char *buf, unsigned len, char *label, u32 command)
} }
static int static int
dbg_port_buf (char *buf, unsigned len, char *label, int port, u32 status) dbg_port_buf (char *buf, unsigned len, const char *label, int port, u32 status)
{ {
char *sig; char *sig;
...@@ -276,19 +277,19 @@ dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -276,19 +277,19 @@ dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
{} {}
static inline int __attribute__((__unused__)) static inline int __attribute__((__unused__))
dbg_status_buf (char *buf, unsigned len, char *label, u32 status) dbg_status_buf (char *buf, unsigned len, const char *label, u32 status)
{ return 0; } { return 0; }
static inline int __attribute__((__unused__)) static inline int __attribute__((__unused__))
dbg_command_buf (char *buf, unsigned len, char *label, u32 command) dbg_command_buf (char *buf, unsigned len, const char *label, u32 command)
{ return 0; } { return 0; }
static inline int __attribute__((__unused__)) static inline int __attribute__((__unused__))
dbg_intr_buf (char *buf, unsigned len, char *label, u32 enable) dbg_intr_buf (char *buf, unsigned len, const char *label, u32 enable)
{ return 0; } { return 0; }
static inline int __attribute__((__unused__)) static inline int __attribute__((__unused__))
dbg_port_buf (char *buf, unsigned len, 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 /* DEBUG */ #endif /* DEBUG */
......
...@@ -353,8 +353,8 @@ static void intr_deschedule ( ...@@ -353,8 +353,8 @@ static void intr_deschedule (
hcd_to_bus (&ehci->hcd)->bandwidth_allocated -= hcd_to_bus (&ehci->hcd)->bandwidth_allocated -=
(qh->usecs + qh->c_usecs) / qh->period; (qh->usecs + qh->c_usecs) / qh->period;
dbg ("descheduled qh %p, period = %d frame = %d count = %d, urbs = %d", ehci_dbg (ehci, "descheduled qh%d/%p frame=%d count=%d, urbs=%d\n",
qh, qh->period, frame, qh->period, qh, frame,
atomic_read (&qh->kref.refcount), ehci->periodic_sched); atomic_read (&qh->kref.refcount), ehci->periodic_sched);
} }
...@@ -486,13 +486,14 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh) ...@@ -486,13 +486,14 @@ static int qh_schedule (struct ehci_hcd *ehci, struct ehci_qh *qh)
qh->hw_info2 &= ~__constant_cpu_to_le32(0xffff); qh->hw_info2 &= ~__constant_cpu_to_le32(0xffff);
qh->hw_info2 |= cpu_to_le32 (1 << uframe) | c_mask; qh->hw_info2 |= cpu_to_le32 (1 << uframe) | c_mask;
} else } else
dbg ("reused previous qh %p schedule", qh); ehci_dbg (ehci, "reused qh %p schedule\n", qh);
/* stuff into the periodic schedule */ /* stuff into the periodic schedule */
qh->qh_state = QH_STATE_LINKED; qh->qh_state = QH_STATE_LINKED;
dbg ("scheduled qh %p usecs %d/%d period %d.0 starting %d.%d (gap %d)", ehci_dbg(ehci,
qh, qh->usecs, qh->c_usecs, "scheduled qh%d/%p usecs %d/%d starting %d.%d (gap %d)\n",
qh->period, frame, uframe, qh->gap_uf); qh->period, qh, qh->usecs, qh->c_usecs,
frame, uframe, qh->gap_uf);
do { do {
if (unlikely (ehci->pshadow [frame].ptr != 0)) { if (unlikely (ehci->pshadow [frame].ptr != 0)) {
......
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