This declares some string parameters "const" so __FUNCTION__ and such
work with those functions, and removes some old-school dbg() calls
(along with the long syslogged pathnames they produce). Please merge.
- Dave
p.s. Still to come, a patch improving integration with system suspend;
needs a bit more testing yet, covering Funky BIOS modes.
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: David Brownell <[EMAIL PROTECTED]>
--- xu26/drivers/usb/host/ehci-dbg.c 2004-10-09 07:35:32.000000000 -0700
+++ gadget-2.6/drivers/usb/host/ehci-dbg.c 2004-10-21 09:19:33.000000000 -0700
@@ -185,7 +185,7 @@
}
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,
"%s%sstatus %04x%s%s%s%s%s%s%s%s%s%s",
@@ -204,7 +204,7 @@
}
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,
"%s%sintrenable %02x%s%s%s%s%s%s",
@@ -221,7 +221,8 @@
static const char *const fls_strings [] =
{ "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,
"%s%scommand %06x %s=%d ithresh=%d%s%s%s%s period=%s%s %s",
@@ -240,7 +241,7 @@
}
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;
@@ -276,19 +277,19 @@
{}
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; }
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; }
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; }
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; }
#endif /* DEBUG */
--- xu26/drivers/usb/host/ehci-sched.c 2004-10-09 07:35:32.000000000 -0700
+++ gadget-2.6/drivers/usb/host/ehci-sched.c 2004-10-22 08:03:19.000000000 -0700
@@ -353,8 +353,8 @@
hcd_to_bus (&ehci->hcd)->bandwidth_allocated -=
(qh->usecs + qh->c_usecs) / qh->period;
- dbg ("descheduled qh %p, period = %d frame = %d count = %d, urbs = %d",
- qh, qh->period, frame,
+ ehci_dbg (ehci, "descheduled qh%d/%p frame=%d count=%d, urbs=%d\n",
+ qh->period, qh, frame,
atomic_read (&qh->kref.refcount), ehci->periodic_sched);
}
@@ -486,13 +486,14 @@
qh->hw_info2 &= ~__constant_cpu_to_le32(0xffff);
qh->hw_info2 |= cpu_to_le32 (1 << uframe) | c_mask;
} else
- dbg ("reused previous qh %p schedule", qh);
+ ehci_dbg (ehci, "reused qh %p schedule\n", qh);
/* stuff into the periodic schedule */
qh->qh_state = QH_STATE_LINKED;
- dbg ("scheduled qh %p usecs %d/%d period %d.0 starting %d.%d (gap %d)",
- qh, qh->usecs, qh->c_usecs,
- qh->period, frame, uframe, qh->gap_uf);
+ ehci_dbg(ehci,
+ "scheduled qh%d/%p usecs %d/%d starting %d.%d (gap %d)\n",
+ qh->period, qh, qh->usecs, qh->c_usecs,
+ frame, uframe, qh->gap_uf);
do {
if (unlikely (ehci->pshadow [frame].ptr != 0)) {