From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>
Subject: [PATCH] sched/core: Remove useless hrtimer_active check
Date: Tue, 19 Jun 2018 16:02:43 +0200 [thread overview]
Message-ID: <1529416963-20271-1-git-send-email-daniel.lezcano@linaro.org> (raw)
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 <daniel.lezcano@linaro.org>
---
kernel/sched/core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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);
}
/*
--
2.7.4
next reply other threads:[~2018-06-19 14:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-19 14:02 Daniel Lezcano [this message]
2018-07-10 16:08 ` Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1529416963-20271-1-git-send-email-daniel.lezcano@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®