Skip to content

Commit

Permalink
usb: gadget: udc: Avoid tasklet passing a global
Browse files Browse the repository at this point in the history
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 <gregkh@linuxfoundation.org>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Kees Cook <keescook@chromium.org>
  • Loading branch information
kees committed Jul 30, 2020
1 parent 11ba468 commit f9dc371
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/usb/gadget/udc/snps_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ static int stop_pollstall_timer;
static DECLARE_COMPLETION(on_pollstall_exit);

/* tasklet for usb disconnect */
static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect,
(unsigned long) &udc);

static DECLARE_TASKLET(disconnect_tasklet, udc_tasklet_disconnect, 0);

/* endpoint names used for print */
static const char ep0_string[] = "ep0in";
Expand Down Expand Up @@ -1661,7 +1659,7 @@ static void usb_disconnect(struct udc *dev)
/* Tasklet for disconnect to be outside of interrupt context */
static void udc_tasklet_disconnect(unsigned long par)
{
struct udc *dev = (struct udc *)(*((struct udc **) par));
struct udc *dev = udc;
u32 tmp;

DBG(dev, "Tasklet disconnect\n");
Expand Down

0 comments on commit f9dc371

Please sign in to comment.