From patchwork Tue Jun 19 14:02:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 139125 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5246069lji; Tue, 19 Jun 2018 07:02:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKIScWR/8yNFM5F0jrZGlQQMNxyHU8QHighgCmdLk/DcQHqfyVYFMGMCdDmoYNB8yYc26Hi X-Received: by 2002:a17:902:b949:: with SMTP id h9-v6mr19063297pls.321.1529416970020; Tue, 19 Jun 2018 07:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529416970; cv=none; d=google.com; s=arc-20160816; b=tN+29QTGfoyV5+ZcRHFg5J6Zb0UFp2nlpcFnfpl89G60ZbPps92fMbpXF+FDhmToVX 6bXa8Su3yJKNgD/kcRURb0Et067VDdQUxHw1Iu+Vo8Cm37XGJZSRc+Tdigar/G5a/38A fSzom0xEuz+aILwdZyp6FfEJg4sCGreZvd+ERxoHMfREhRQP+8r8hks0EbCTLA6ylYN5 lt/pgBYJ3zAGkX9SIVWb8Hpe407bxZnWJbjyMgvO+rvEjhndspu07Aijm59gXxBFvyBd YwTsWTGMAwKiokYcB2SsgDnKkBIOwJKQtn+kdP8GRrUVLb5QyzKWkPOgTDTpaganrsxO cWTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Ctd76Nwcdm/gu8YSl6riGcz8gnZ0lC31LC7xeRPsRHo=; b=nfDXvc9W1TCIz1c93TNVb/4rqjhehXcPgg09DeexSXuUiGOe6DM5I2XCDQQtOc5gcL 4ZNx6kAa4JXNFEugX1UlivHz/c9WT0/qlOkzaUVddUIp8j9feCVvA6bOIuRsCRxqA7lR MBJdh5ClbZSy0B098M0Kmz4BTlh5PdubN/WKbjF20oqYF1VtZO6u0Solc0RSJLUDrCs3 jB0yguX/oLVCzzRTXy2010xiSZZKZkGQEb7B7EpNcGHJ3MoUuknsNw3O3l+jd4ps0EO1 RvoQIU4SDgkOcoeH0AHMpkYscUhZhPGEXNPkNMaDPaCuDnGM7QA5i/JIKRe6dJjzIxIr Zp5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HJUQpTiY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3-v6si13965945pgp.496.2018.06.19.07.02.49; Tue, 19 Jun 2018 07:02:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HJUQpTiY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966550AbeFSOCr (ORCPT + 30 others); Tue, 19 Jun 2018 10:02:47 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53587 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966111AbeFSOCq (ORCPT ); Tue, 19 Jun 2018 10:02:46 -0400 Received: by mail-wm0-f65.google.com with SMTP id x6-v6so583394wmc.3 for ; Tue, 19 Jun 2018 07:02:45 -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=Ctd76Nwcdm/gu8YSl6riGcz8gnZ0lC31LC7xeRPsRHo=; b=HJUQpTiYGMPhgpNXV6da7Wyz6FS0Dwwq+EgMbTspnuP5QddMjUCTDSF3pst2usKUXb qD5ftzXlBkJssZMGKxYymZxqLk9jFhYYO9ml6Hf8+Nuqa43K+bbKCUkIH4NROkKferCI ntJ96b+eeCSR25mugoLlL0peKULO+qpcsDe1Y= 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=Ctd76Nwcdm/gu8YSl6riGcz8gnZ0lC31LC7xeRPsRHo=; b=FWfOiEZee8WeLziOjPZ1tkBWSLFxTSTh/YWc1KTdYKQeXgLPtfEtWEHnul17BGBLrL XPDvwkhuL1qgg2JXZUTBKO/h6HEt+iOKSDxFHw/xrcP6dpH2guCvxkergF3tMlXXr7h+ d2RdNPBK/1D/vP6+POoVfMT8C3nuC/Hq9tfSUxOf8nUa7nJHleVvIEV0clYUCoLycwuE rcmn4jqDlxkHc66vHwhvcxR2GcOJX+Hd9+72EuZK2sAeDHOvgnwwUjjQ67HbI+UBhXj6 tnAs/OPiIvmHAx/taP05ZoqzjQOBF13t44vOgPSgE91af4JD/PToRxVFaA4WHTRUdBXu wXlw== X-Gm-Message-State: APt69E3LIK3zM5ep5h7jcaV/9y0yYYUZiRyJqDYSrnZcXiEJkxN4ZOqH w/NuBOGbjQmu+7ZIBrWeJPPx9Q== X-Received: by 2002:a1c:96d3:: with SMTP id y202-v6mr11674786wmd.76.1529416965190; Tue, 19 Jun 2018 07:02:45 -0700 (PDT) Received: from mai.localdomain (135-224-190-109.dsl.ovh.fr. [109.190.224.135]) by smtp.gmail.com with ESMTPSA id o16-v6sm18375298wrp.8.2018.06.19.07.02.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Jun 2018 07:02:44 -0700 (PDT) From: Daniel Lezcano To: peterz@infradead.org Cc: linux-kernel@vger.kernel.org, Ingo Molnar Subject: [PATCH] sched/core: Remove useless hrtimer_active check Date: Tue, 19 Jun 2018 16:02:43 +0200 Message-Id: <1529416963-20271-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function tick_clear() checks if the timer is active and in this case cancels the timer. However, hrtimer_cancel does the same check. Perhaps, this test is made on purpose to skip some function calls for efficiency reasons but if it is not the case we can safely remove it. Signed-off-by: Daniel Lezcano --- kernel/sched/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.7.4 diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d155518..aa46aa6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -218,8 +218,7 @@ void update_rq_clock(struct rq *rq) static void hrtick_clear(struct rq *rq) { - if (hrtimer_active(&rq->hrtick_timer)) - hrtimer_cancel(&rq->hrtick_timer); + hrtimer_cancel(&rq->hrtick_timer); } /*