public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Use time_after()
@ 2014-05-22 17:45 Manuel Schölling
  2014-06-05 14:34 ` [tip:sched/core] sched/fair: Use time_after() in record_wakee() tip-bot for Manuel Schölling
  0 siblings, 1 reply; 2+ messages in thread
From: Manuel Schölling @ 2014-05-22 17:45 UTC (permalink / raw)
  To: mingo; +Cc: peterz, linux-kernel, kernel-janitors, Manuel Schölling

To be future-proof and for better readability the time comparisons are modified
to use time_after() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
---
 kernel/sched/fair.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 7570dd9..716360a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4014,7 +4014,7 @@ static void record_wakee(struct task_struct *p)
 	 * about the boundary, really active task won't care
 	 * about the loss.
 	 */
-	if (jiffies > current->wakee_flip_decay_ts + HZ) {
+	if (time_after(jiffies, current->wakee_flip_decay_ts + HZ)) {
 		current->wakee_flips = 0;
 		current->wakee_flip_decay_ts = jiffies;
 	}
-- 
1.7.10.4


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

end of thread, other threads:[~2014-06-05 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-22 17:45 [PATCH] sched: Use time_after() Manuel Schölling
2014-06-05 14:34 ` [tip:sched/core] sched/fair: Use time_after() in record_wakee() tip-bot for Manuel Schölling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox