Skip to content

Commit

Permalink
net/usb/drivers: Remove useless hrtimer_active check
Browse files Browse the repository at this point in the history
The code does:

 if (hrtimer_active(&t))
    hrtimer_cancel(&t);

However, hrtimer_cancel() checks if the timer is active, so the
test above is pointless.

Signed-off-by: Daniel Lezcano <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dlezcano authored and davem330 committed Jun 20, 2018
1 parent cbf56c2 commit 2aee167
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -967,8 +967,7 @@ void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf)

atomic_set(&ctx->stop, 1);

if (hrtimer_active(&ctx->tx_timer))
hrtimer_cancel(&ctx->tx_timer);
hrtimer_cancel(&ctx->tx_timer);

tasklet_kill(&ctx->bh);

Expand Down

0 comments on commit 2aee167

Please sign in to comment.