netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/usb/drivers: Remove useless hrtimer_active check
@ 2018-06-19 14:14 Daniel Lezcano
  2018-06-20  0:07 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Lezcano @ 2018-06-19 14:14 UTC (permalink / raw)
  To: oliver
  Cc: David S. Miller, open list:USB CDC ETHERNET DRIVER,
	open list:NETWORKING DRIVERS, open list

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 <daniel.lezcano@linaro.org>
---
 drivers/net/usb/cdc_ncm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 90d07ed..732ceff 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -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);
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/usb/drivers: Remove useless hrtimer_active check
  2018-06-19 14:14 [PATCH] net/usb/drivers: Remove useless hrtimer_active check Daniel Lezcano
@ 2018-06-20  0:07 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-06-20  0:07 UTC (permalink / raw)
  To: daniel.lezcano; +Cc: oliver, linux-usb, netdev, linux-kernel

From: Daniel Lezcano <daniel.lezcano@linaro.org>
Date: Tue, 19 Jun 2018 16:14:30 +0200

> 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 <daniel.lezcano@linaro.org>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-20  0:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-19 14:14 [PATCH] net/usb/drivers: Remove useless hrtimer_active check Daniel Lezcano
2018-06-20  0:07 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).