Skip to content

Commit 17f8bb7

Browse files
Olav Kongasgregkh
authored andcommitted
[PATCH] USB: isp116x-hcd cleanup
Sorry that it took so long. Here comes a cleanup patch that addresses the remarks by Alexey Dobriyan about gregkh-usb-usb-isp116x-hcd-add.patch EXCEPT the remark about the typecasting of mem_flags argument for kcalloc; this will be addressed in a later patch. OlavCleanup of isp116x-hcd. Signed off by: Olav Kongas <ok@artecdesign.ee> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent ae0d6cc commit 17f8bb7

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

‎drivers/usb/host/isp116x-hcd.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* The driver basically works. A number of people have used it with a range
1818
* of devices.
1919
*
20-
*The driver passes all usbtests 1-14.
20+
* The driver passes all usbtests 1-14.
2121
*
2222
* Suspending/resuming of root hub via sysfs works. Remote wakeup works too.
2323
* And suspending/resuming of platform device works too. Suspend/resume
@@ -229,7 +229,7 @@ static void preproc_atl_queue(struct isp116x *isp116x)
229229
struct isp116x_ep *ep;
230230
struct urb *urb;
231231
struct ptd *ptd;
232-
u16 toggle, dir, len;
232+
u16 toggle = 0, dir = PTD_DIR_SETUP, len;
233233

234234
for (ep = isp116x->atl_active; ep; ep = ep->active) {
235235
BUG_ON(list_empty(&ep->hep->urb_list));
@@ -251,8 +251,6 @@ static void preproc_atl_queue(struct isp116x *isp116x)
251251
dir = PTD_DIR_OUT;
252252
break;
253253
case USB_PID_SETUP:
254-
toggle = 0;
255-
dir = PTD_DIR_SETUP;
256254
len = sizeof(struct usb_ctrlrequest);
257255
ep->data = urb->setup_packet;
258256
break;
@@ -264,11 +262,9 @@ static void preproc_atl_queue(struct isp116x *isp116x)
264262
? PTD_DIR_OUT : PTD_DIR_IN;
265263
break;
266264
default:
267-
/* To please gcc */
268-
toggle = dir = 0;
269265
ERR("%s %d: ep->nextpid %d\n", __func__, __LINE__,
270266
ep->nextpid);
271-
BUG_ON(1);
267+
BUG();
272268
}
273269

274270
ptd->count = PTD_CC_MSK | PTD_ACTIVE_MSK | PTD_TOGGLE(toggle);
@@ -1054,7 +1050,7 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
10541050
break;
10551051
case GetHubStatus:
10561052
DBG("GetHubStatus\n");
1057-
*(__le32 *) buf = cpu_to_le32(0);
1053+
*(__le32 *) buf = 0;
10581054
break;
10591055
case GetPortStatus:
10601056
DBG("GetPortStatus\n");
@@ -1810,9 +1806,9 @@ static int isp116x_suspend(struct device *dev, pm_message_t state, u32 phase)
18101806
ret = usb_suspend_device(hcd->self.root_hub, state);
18111807
if (!ret) {
18121808
dev->power.power_state = state;
1813-
INFO("%s suspended\n", (char *)hcd_name);
1809+
INFO("%s suspended\n", hcd_name);
18141810
} else
1815-
ERR("%s suspend failed\n", (char *)hcd_name);
1811+
ERR("%s suspend failed\n", hcd_name);
18161812

18171813
return ret;
18181814
}

0 commit comments

Comments
 (0)