lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 19 Jun 2018 16:02:43 +0200
From:   Daniel Lezcano <daniel.lezcano@...aro.org>
To:     peterz@...radead.org
Cc:     linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>
Subject: [PATCH] sched/core: Remove useless hrtimer_active check

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@...aro.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ