Skip to content
Browse files

sched: fix warning in hrtick_start_fair()

Benjamin Herrenschmidt reported:

> I get that on ppc64 ...
> In file included from kernel/sched.c:1595:
> kernel/sched_fair.c: In function ‘hrtick_start_fair’:
> kernel/sched_fair.c:902: warning: comparison of distinct pointer types lacks a cast
> Probably harmless but annoying.

s64 delta = slice - ran;

-->	delta = max(10000LL, delta);

Probably ppc64's s64 is long vs long long..

I think hpa was looking at sanitizing all these 64bit types across the

Use max_t with an explicit type meanwhile.

Reported-by: Benjamin Herrenschmid <>
Signed-off-by: Peter Zijlstra <>
Signed-off-by: Ingo Molnar <>
  • Loading branch information...
1 parent c9272c4 commit 157124c11f4217733691223ecf5ee47558ae9495 Peter Zijlstra committed with Ingo Molnar Jul 28, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 kernel/sched_fair.c
2 kernel/sched_fair.c
@@ -899,7 +899,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p)
* doesn't make sense. Rely on vruntime for fairness.
if (rq->curr != p)
- delta = max(10000LL, delta);
+ delta = max_t(s64, 10000LL, delta);
hrtick_start(rq, delta);

0 comments on commit 157124c

Please sign in to comment.
Something went wrong with that request. Please try again.