Commit 3171fcab authored by Chen Gang's avatar Chen Gang Committed by Greg Kroah-Hartman

USB: uhci: beautify source code

  get rid of the line breaks in string constants.
  let comments within 80 with limitation.
  delete ' \' at the end of a statement.
Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8f0302b
...@@ -151,8 +151,8 @@ static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, ...@@ -151,8 +151,8 @@ static int uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp,
} }
} }
if (nactive + ninactive > 0) if (nactive + ninactive > 0)
out += sprintf(out, "%*s[skipped %d inactive and %d active " out += sprintf(out,
"TDs]\n", "%*s[skipped %d inactive and %d active TDs]\n",
space, "", ninactive, nactive); space, "", ninactive, nactive);
done: done:
if (out - buf > len) if (out - buf > len)
...@@ -182,8 +182,8 @@ static int uhci_show_qh(struct uhci_hcd *uhci, ...@@ -182,8 +182,8 @@ static int uhci_show_qh(struct uhci_hcd *uhci,
hc32_to_cpu(uhci, qh->link), hc32_to_cpu(uhci, qh->link),
hc32_to_cpu(uhci, element)); hc32_to_cpu(uhci, element));
if (qh->type == USB_ENDPOINT_XFER_ISOC) if (qh->type == USB_ENDPOINT_XFER_ISOC)
out += sprintf(out, "%*s period %d phase %d load %d us, " out += sprintf(out,
"frame %x desc [%p]\n", "%*s period %d phase %d load %d us, frame %x desc [%p]\n",
space, "", qh->period, qh->phase, qh->load, space, "", qh->period, qh->phase, qh->load,
qh->iso_frame, qh->iso_packet_desc); qh->iso_frame, qh->iso_packet_desc);
else if (qh->type == USB_ENDPOINT_XFER_INT) else if (qh->type == USB_ENDPOINT_XFER_INT)
...@@ -434,8 +434,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) ...@@ -434,8 +434,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
tmp = tmp->next; tmp = tmp->next;
if (link != LINK_TO_TD(uhci, td)) { if (link != LINK_TO_TD(uhci, td)) {
if (nframes > 0) { if (nframes > 0) {
out += sprintf(out, " link does " out += sprintf(out,
"not match list entry!\n"); " link does not match list entry!\n");
if (out - buf > len) if (out - buf > len)
goto done; goto done;
} else } else
...@@ -460,8 +460,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) ...@@ -460,8 +460,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
i, hc32_to_cpu(uhci, link)); i, hc32_to_cpu(uhci, link));
j = 1; j = 1;
} }
out += sprintf(out, " link does not match " out += sprintf(out,
"QH (%08x)!\n", " link does not match QH (%08x)!\n",
hc32_to_cpu(uhci, qh_dma)); hc32_to_cpu(uhci, qh_dma));
if (out - buf > len) if (out - buf > len)
goto done; goto done;
...@@ -483,7 +483,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) ...@@ -483,7 +483,7 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
int cnt = 0; int cnt = 0;
qh = uhci->skelqh[i]; qh = uhci->skelqh[i];
out += sprintf(out, "- skel_%s_qh\n", qh_names[i]); \ out += sprintf(out, "- skel_%s_qh\n", qh_names[i]);
out += uhci_show_qh(uhci, qh, out, len - (out - buf), 4); out += uhci_show_qh(uhci, qh, out, len - (out - buf), 4);
if (out - buf > len) if (out - buf > len)
goto tail; goto tail;
...@@ -491,7 +491,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) ...@@ -491,7 +491,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
/* Last QH is the Terminating QH, it's different */ /* Last QH is the Terminating QH, it's different */
if (i == SKEL_TERM) { if (i == SKEL_TERM) {
if (qh_element(qh) != LINK_TO_TD(uhci, uhci->term_td)) { if (qh_element(qh) != LINK_TO_TD(uhci, uhci->term_td)) {
out += sprintf(out, " skel_term_qh element is not set to term_td!\n"); out += sprintf(out,
" skel_term_qh element is not set to term_td!\n");
if (out - buf > len) if (out - buf > len)
goto done; goto done;
} }
...@@ -530,7 +531,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) ...@@ -530,7 +531,8 @@ static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len)
link = LINK_TO_QH(uhci, uhci->skel_term_qh); link = LINK_TO_QH(uhci, uhci->skel_term_qh);
check_qh_link: check_qh_link:
if (qh->link != link) if (qh->link != link)
out += sprintf(out, " last QH not linked to next skeleton!\n"); out += sprintf(out,
" last QH not linked to next skeleton!\n");
if (out - buf > len) if (out - buf > len)
goto done; goto done;
...@@ -587,7 +589,9 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence) ...@@ -587,7 +589,9 @@ static loff_t uhci_debug_lseek(struct file *file, loff_t off, int whence)
up = file->private_data; up = file->private_data;
/* XXX: atomic 64bit seek access, but that needs to be fixed in the VFS */ /*
* XXX: atomic 64bit seek access, but that needs to be fixed in the VFS
*/
switch (whence) { switch (whence) {
case 0: case 0:
new = off; new = off;
......
...@@ -449,17 +449,16 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd) ...@@ -449,17 +449,16 @@ static irqreturn_t uhci_irq(struct usb_hcd *hcd)
if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) { if (status & ~(USBSTS_USBINT | USBSTS_ERROR | USBSTS_RD)) {
if (status & USBSTS_HSE) if (status & USBSTS_HSE)
dev_err(uhci_dev(uhci), "host system error, " dev_err(uhci_dev(uhci),
"PCI problems?\n"); "host system error, PCI problems?\n");
if (status & USBSTS_HCPE) if (status & USBSTS_HCPE)
dev_err(uhci_dev(uhci), "host controller process " dev_err(uhci_dev(uhci),
"error, something bad happened!\n"); "host controller process error, something bad happened!\n");
if (status & USBSTS_HCH) { if (status & USBSTS_HCH) {
spin_lock(&uhci->lock); spin_lock(&uhci->lock);
if (uhci->rh_state >= UHCI_RH_RUNNING) { if (uhci->rh_state >= UHCI_RH_RUNNING) {
dev_err(uhci_dev(uhci), dev_err(uhci_dev(uhci),
"host controller halted, " "host controller halted, very bad!\n");
"very bad!\n");
if (debug > 1 && errbuf) { if (debug > 1 && errbuf) {
/* Print the schedule for debugging */ /* Print the schedule for debugging */
uhci_sprint_schedule(uhci, errbuf, uhci_sprint_schedule(uhci, errbuf,
...@@ -589,8 +588,8 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -589,8 +588,8 @@ static int uhci_start(struct usb_hcd *hcd)
UHCI_NUMFRAMES * sizeof(*uhci->frame), UHCI_NUMFRAMES * sizeof(*uhci->frame),
&uhci->frame_dma_handle, 0); &uhci->frame_dma_handle, 0);
if (!uhci->frame) { if (!uhci->frame) {
dev_err(uhci_dev(uhci), "unable to allocate " dev_err(uhci_dev(uhci),
"consistent memory for frame list\n"); "unable to allocate consistent memory for frame list\n");
goto err_alloc_frame; goto err_alloc_frame;
} }
memset(uhci->frame, 0, UHCI_NUMFRAMES * sizeof(*uhci->frame)); memset(uhci->frame, 0, UHCI_NUMFRAMES * sizeof(*uhci->frame));
...@@ -598,8 +597,8 @@ static int uhci_start(struct usb_hcd *hcd) ...@@ -598,8 +597,8 @@ static int uhci_start(struct usb_hcd *hcd)
uhci->frame_cpu = kcalloc(UHCI_NUMFRAMES, sizeof(*uhci->frame_cpu), uhci->frame_cpu = kcalloc(UHCI_NUMFRAMES, sizeof(*uhci->frame_cpu),
GFP_KERNEL); GFP_KERNEL);
if (!uhci->frame_cpu) { if (!uhci->frame_cpu) {
dev_err(uhci_dev(uhci), "unable to allocate " dev_err(uhci_dev(uhci),
"memory for frame pointers\n"); "unable to allocate memory for frame pointers\n");
goto err_alloc_frame_cpu; goto err_alloc_frame_cpu;
} }
...@@ -734,8 +733,8 @@ static int uhci_rh_suspend(struct usb_hcd *hcd) ...@@ -734,8 +733,8 @@ static int uhci_rh_suspend(struct usb_hcd *hcd)
*/ */
else if (hcd->self.root_hub->do_remote_wakeup && else if (hcd->self.root_hub->do_remote_wakeup &&
uhci->resuming_ports) { uhci->resuming_ports) {
dev_dbg(uhci_dev(uhci), "suspend failed because a port " dev_dbg(uhci_dev(uhci),
"is resuming\n"); "suspend failed because a port is resuming\n");
rc = -EBUSY; rc = -EBUSY;
} else } else
suspend_rh(uhci, UHCI_RH_SUSPENDED); suspend_rh(uhci, UHCI_RH_SUSPENDED);
...@@ -826,8 +825,8 @@ static int uhci_count_ports(struct usb_hcd *hcd) ...@@ -826,8 +825,8 @@ static int uhci_count_ports(struct usb_hcd *hcd)
/* Anything greater than 7 is weird so we'll ignore it. */ /* Anything greater than 7 is weird so we'll ignore it. */
if (port > UHCI_RH_MAXCHILD) { if (port > UHCI_RH_MAXCHILD) {
dev_info(uhci_dev(uhci), "port count misdetected? " dev_info(uhci_dev(uhci),
"forcing to 2 ports\n"); "port count misdetected? forcing to 2 ports\n");
port = 2; port = 2;
} }
......
...@@ -21,8 +21,8 @@ static const __u8 root_hub_hub_des[] = ...@@ -21,8 +21,8 @@ static const __u8 root_hub_hub_des[] =
0x00, /* (per-port OC, no power switching) */ 0x00, /* (per-port OC, no power switching) */
0x01, /* __u8 bPwrOn2pwrGood; 2ms */ 0x01, /* __u8 bPwrOn2pwrGood; 2ms */
0x00, /* __u8 bHubContrCurrent; 0 mA */ 0x00, /* __u8 bHubContrCurrent; 0 mA */
0x00, /* __u8 DeviceRemovable; *** 7 Ports max *** */ 0x00, /* __u8 DeviceRemovable; *** 7 Ports max */
0xff /* __u8 PortPwrCtrlMask; *** 7 ports max *** */ 0xff /* __u8 PortPwrCtrlMask; *** 7 ports max */
}; };
#define UHCI_RH_MAXCHILD 7 #define UHCI_RH_MAXCHILD 7
......
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