diff options
author | John Youn <John.Youn@synopsys.com> | 2017-01-17 23:30:27 -0500 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-01-24 04:04:18 -0500 |
commit | 9da5197475a09e51a467388308f14dcbdcee8ba9 (patch) | |
tree | b1c4aa514bacc1abbd33b6cdffcb04db3e0b1908 /drivers/usb/dwc2/hcd_queue.c | |
parent | 33e4c1a9987a1fc3b42c3b534100b5b006d55c61 (diff) |
usb: dwc2: Cleanup some checkpatch issues
This commmit is the result of running checkpatch --fix.
The results were verified for correctness. Some of the fixes result in
line over 80 char which we will fix manually later.
The following is a summary of what was done by checkpatch:
* Remove externs on function prototypes.
* Replace symbolic permissions with octal.
* Align code to open parens.
* Replace 'unsigned' with 'unsigned int'.
* Remove unneccessary blank lines.
* Add blank lines after declarations.
* Add spaces around operators.
* Remove unnecessary spaces after casts.
* Replace 'x == NULL' with '!x'.
* Replace kzalloc() with kcalloc().
* Concatenate multi-line strings.
* Use the BIT() macro.
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc2/hcd_queue.c')
-rw-r--r-- | drivers/usb/dwc2/hcd_queue.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c index 5713f03a4e56..06d036f608f1 100644 --- a/drivers/usb/dwc2/hcd_queue.c +++ b/drivers/usb/dwc2/hcd_queue.c | |||
@@ -82,8 +82,8 @@ static int dwc2_periodic_channel_available(struct dwc2_hsotg *hsotg) | |||
82 | status = 0; | 82 | status = 0; |
83 | } else { | 83 | } else { |
84 | dev_dbg(hsotg->dev, | 84 | dev_dbg(hsotg->dev, |
85 | "%s: Total channels: %d, Periodic: %d, " | 85 | "%s: Total channels: %d, Periodic: %d, Non-periodic: %d\n", |
86 | "Non-periodic: %d\n", __func__, num_channels, | 86 | __func__, num_channels, |
87 | hsotg->periodic_channels, hsotg->non_periodic_channels); | 87 | hsotg->periodic_channels, hsotg->non_periodic_channels); |
88 | status = -ENOSPC; | 88 | status = -ENOSPC; |
89 | } | 89 | } |
@@ -485,7 +485,6 @@ static void pmap_print(unsigned long *map, int bits_per_period, | |||
485 | } | 485 | } |
486 | } | 486 | } |
487 | 487 | ||
488 | |||
489 | struct dwc2_qh_print_data { | 488 | struct dwc2_qh_print_data { |
490 | struct dwc2_hsotg *hsotg; | 489 | struct dwc2_hsotg *hsotg; |
491 | struct dwc2_qh *qh; | 490 | struct dwc2_qh *qh; |
@@ -587,7 +586,7 @@ static int dwc2_ls_pmap_schedule(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, | |||
587 | unsigned long *map = dwc2_get_ls_map(hsotg, qh); | 586 | unsigned long *map = dwc2_get_ls_map(hsotg, qh); |
588 | int slice; | 587 | int slice; |
589 | 588 | ||
590 | if (map == NULL) | 589 | if (!map) |
591 | return -EINVAL; | 590 | return -EINVAL; |
592 | 591 | ||
593 | /* | 592 | /* |
@@ -626,7 +625,7 @@ static void dwc2_ls_pmap_unschedule(struct dwc2_hsotg *hsotg, | |||
626 | unsigned long *map = dwc2_get_ls_map(hsotg, qh); | 625 | unsigned long *map = dwc2_get_ls_map(hsotg, qh); |
627 | 626 | ||
628 | /* Schedule should have failed, so no worries about no error code */ | 627 | /* Schedule should have failed, so no worries about no error code */ |
629 | if (map == NULL) | 628 | if (!map) |
630 | return; | 629 | return; |
631 | 630 | ||
632 | pmap_unschedule(map, DWC2_LS_PERIODIC_SLICES_PER_FRAME, | 631 | pmap_unschedule(map, DWC2_LS_PERIODIC_SLICES_PER_FRAME, |
@@ -1182,7 +1181,7 @@ exit: | |||
1182 | qh->start_active_frame = next_active_frame; | 1181 | qh->start_active_frame = next_active_frame; |
1183 | 1182 | ||
1184 | dwc2_sch_vdbg(hsotg, "QH=%p First fn=%04x nxt=%04x\n", | 1183 | dwc2_sch_vdbg(hsotg, "QH=%p First fn=%04x nxt=%04x\n", |
1185 | qh, frame_number, qh->next_active_frame); | 1184 | qh, frame_number, qh->next_active_frame); |
1186 | } | 1185 | } |
1187 | 1186 | ||
1188 | /** | 1187 | /** |
@@ -1501,7 +1500,6 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, | |||
1501 | device_ns += dwc_tt->usb_tt->think_time; | 1500 | device_ns += dwc_tt->usb_tt->think_time; |
1502 | qh->device_us = NS_TO_US(device_ns); | 1501 | qh->device_us = NS_TO_US(device_ns); |
1503 | 1502 | ||
1504 | |||
1505 | qh->device_interval = urb->interval; | 1503 | qh->device_interval = urb->interval; |
1506 | qh->host_interval = urb->interval * (do_split ? 8 : 1); | 1504 | qh->host_interval = urb->interval * (do_split ? 8 : 1); |
1507 | 1505 | ||
@@ -1587,7 +1585,7 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, | |||
1587 | * Return: Pointer to the newly allocated QH, or NULL on error | 1585 | * Return: Pointer to the newly allocated QH, or NULL on error |
1588 | */ | 1586 | */ |
1589 | struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, | 1587 | struct dwc2_qh *dwc2_hcd_qh_create(struct dwc2_hsotg *hsotg, |
1590 | struct dwc2_hcd_urb *urb, | 1588 | struct dwc2_hcd_urb *urb, |
1591 | gfp_t mem_flags) | 1589 | gfp_t mem_flags) |
1592 | { | 1590 | { |
1593 | struct dwc2_qh *qh; | 1591 | struct dwc2_qh *qh; |
@@ -1741,7 +1739,7 @@ void dwc2_hcd_qh_unlink(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) | |||
1741 | * Return: number missed by (or 0 if we didn't miss). | 1739 | * Return: number missed by (or 0 if we didn't miss). |
1742 | */ | 1740 | */ |
1743 | static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg, | 1741 | static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg, |
1744 | struct dwc2_qh *qh, u16 frame_number) | 1742 | struct dwc2_qh *qh, u16 frame_number) |
1745 | { | 1743 | { |
1746 | u16 old_frame = qh->next_active_frame; | 1744 | u16 old_frame = qh->next_active_frame; |
1747 | u16 prev_frame_number = dwc2_frame_num_dec(frame_number, 1); | 1745 | u16 prev_frame_number = dwc2_frame_num_dec(frame_number, 1); |
@@ -1804,7 +1802,7 @@ static int dwc2_next_for_periodic_split(struct dwc2_hsotg *hsotg, | |||
1804 | * Return: number missed by (or 0 if we didn't miss). | 1802 | * Return: number missed by (or 0 if we didn't miss). |
1805 | */ | 1803 | */ |
1806 | static int dwc2_next_periodic_start(struct dwc2_hsotg *hsotg, | 1804 | static int dwc2_next_periodic_start(struct dwc2_hsotg *hsotg, |
1807 | struct dwc2_qh *qh, u16 frame_number) | 1805 | struct dwc2_qh *qh, u16 frame_number) |
1808 | { | 1806 | { |
1809 | int missed = 0; | 1807 | int missed = 0; |
1810 | u16 interval = qh->host_interval; | 1808 | u16 interval = qh->host_interval; |
@@ -1926,7 +1924,7 @@ void dwc2_hcd_qh_deactivate(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh, | |||
1926 | missed = dwc2_next_periodic_start(hsotg, qh, frame_number); | 1924 | missed = dwc2_next_periodic_start(hsotg, qh, frame_number); |
1927 | 1925 | ||
1928 | dwc2_sch_vdbg(hsotg, | 1926 | dwc2_sch_vdbg(hsotg, |
1929 | "QH=%p next(%d) fn=%04x, sch=%04x=>%04x (%+d) miss=%d %s\n", | 1927 | "QH=%p next(%d) fn=%04x, sch=%04x=>%04x (%+d) miss=%d %s\n", |
1930 | qh, sched_next_periodic_split, frame_number, old_frame, | 1928 | qh, sched_next_periodic_split, frame_number, old_frame, |
1931 | qh->next_active_frame, | 1929 | qh->next_active_frame, |
1932 | dwc2_frame_num_dec(qh->next_active_frame, old_frame), | 1930 | dwc2_frame_num_dec(qh->next_active_frame, old_frame), |