From patchwork Tue Jun 19 14:14:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 10474619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF120603B5 for ; Tue, 19 Jun 2018 14:14:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16A72860B for ; Tue, 19 Jun 2018 14:14:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D54E628C13; Tue, 19 Jun 2018 14:14:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AF482860B for ; Tue, 19 Jun 2018 14:14:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937547AbeFSOOp (ORCPT ); Tue, 19 Jun 2018 10:14:45 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37790 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752308AbeFSOOn (ORCPT ); Tue, 19 Jun 2018 10:14:43 -0400 Received: by mail-wm0-f66.google.com with SMTP id r125-v6so754597wmg.2 for ; Tue, 19 Jun 2018 07:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=yiHrwybgDoD6NSTa+4Xvi6OKaWvrnBtV7FJFuea5AcM=; b=D8EdfLn0nYXTOflE+hqV5fiz2HL1otIOUF2Fwx1u5xtkT4KeetE0wJahH+T1gK7Z7L IbLFA/ZJDPwMpfPOiWBFTR6mwsSiYxOJDG7cYAOE5L+2s1nJCztt3OTrlJok4RYlgd4j kYd/vULDRpOJI4+FaGw6aF7Sh6P6BT4stW7vI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yiHrwybgDoD6NSTa+4Xvi6OKaWvrnBtV7FJFuea5AcM=; b=YYctk/Ve/0Nih26XqBVvjggqylQJb/nyLvGp8ncV+y3V06uqXmmRQRe4AyL9s9wpS1 pB6Jt134DzIt4EWztMj8cP6UwMPp01MhH7fwS8UoXNG+z4pdXbGiQGDsL+/sa7/sHrgl /fMuOp+TK2w4/F3G5nwHUILy3XgHOf03zWy1WILv+sjbpMjz+e1QujNkezrxRMoDdNs4 v/jZmvePxbH23H8BdKZhRvA92BuC7emPl9fauQklsK2hnqJ+nvM3ZEEaOx3If0jSymcw 2cof8FJhO/cQxhX/J3pgwQV2+W4HWtRLyybsIUQINiGlDP3+rcq3jAC7nAltDHVNocO5 Lr6Q== X-Gm-Message-State: APt69E1F44vOZggMFb/kd7zBZE9naaxeuVhibT2XJ7kyN0X5SLxw2/SB ErK+XXMmHtaV6rjEwZEUvVYa3VTdD5Y= X-Google-Smtp-Source: ADUXVKKoVYouWAwUo8dxYCO4PTMJT/PdZked+60itkQaNYiInrrf/350f3tVbiiXBzrANrbTwShOWw== X-Received: by 2002:a1c:a54e:: with SMTP id o75-v6mr12472752wme.157.1529417682402; Tue, 19 Jun 2018 07:14:42 -0700 (PDT) Received: from mai.localdomain (135-224-190-109.dsl.ovh.fr. [109.190.224.135]) by smtp.gmail.com with ESMTPSA id 12-v6sm293197wmt.19.2018.06.19.07.14.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 07:14:41 -0700 (PDT) From: Daniel Lezcano To: oliver@neukum.org Cc: "David S. Miller" , linux-usb@vger.kernel.org (open list:USB CDC ETHERNET DRIVER), netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH] net/usb/drivers: Remove useless hrtimer_active check Date: Tue, 19 Jun 2018 16:14:30 +0200 Message-Id: <1529417671-21384-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);