Skip to content

Commit f9dc371

Browse files
committed
usb: gadget: udc: Avoid tasklet passing a global
There's no reason for the tasklet callback to set an argument since it always uses a global. Instead, use the global directly, in preparation for converting the tasklet subsystem to modern callback conventions. Reviewed-by: Greg Kroah-Hartman <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Signed-off-by: Kees Cook <[email protected]>
1 parent 11ba468 commit f9dc371

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/usb/gadget/udc/snps_udc_core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ static int stop_pollstall_timer;
9696
static DECLARE_COMPLETION(on_pollstall_exit);
9797

9898
/* tasklet for usb disconnect */
99-
static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect,
100-
(unsigned long) &udc);
101-
99+
static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, 0);
102100

103101
/* endpoint names used for print */
104102
static const char ep0_string[] = "ep0in";
@@ -1661,7 +1659,7 @@ static void usb_disconnect(struct udc *dev)
16611659
/* Tasklet for disconnect to be outside of interrupt context */
16621660
static void udc_tasklet_disconnect(unsigned long par)
16631661
{
1664-
struct udc *dev = (struct udc *)(*((struct udc **) par));
1662+
struct udc *dev = udc;
16651663
u32 tmp;
16661664

16671665
DBG(dev, "Tasklet disconnect\n");

0 commit comments

Comments
 (0)