diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-12-30 11:24:35 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-12-30 11:24:35 -0500 |
commit | 90b2628f1fe94a667330d425a7fb76ec8d2a49ec (patch) | |
tree | 9c315298f0cae3e56ff58a70a0a6bdb5256bc9dc | |
parent | e697789d64f8748cb219d7f5c413c512953802cc (diff) |
sched: fix gcc warnings
Meelis Roos reported these warnings on sparc64:
CC kernel/sched.o
In file included from kernel/sched.c:879:
kernel/sched_debug.c: In function 'nsec_high':
kernel/sched_debug.c:38: warning: comparison of distinct pointer types lacks a cast
the debug check in do_div() is over-eager here, because the long long
is always positive in these places. Mark this by casting them to
unsigned long long.
no change in code output:
text data bss dec hex filename
51471 6582 376 58429 e43d sched.o.before
51471 6582 376 58429 e43d sched.o.after
md5:
7f7729c111f185bf3ccea4d542abc049 sched.o.before.asm
7f7729c111f185bf3ccea4d542abc049 sched.o.after.asm
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | kernel/sched_debug.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c index d30467b47ddd..80fbbfc04290 100644 --- a/kernel/sched_debug.c +++ b/kernel/sched_debug.c | |||
@@ -31,9 +31,9 @@ | |||
31 | /* | 31 | /* |
32 | * Ease the printing of nsec fields: | 32 | * Ease the printing of nsec fields: |
33 | */ | 33 | */ |
34 | static long long nsec_high(long long nsec) | 34 | static long long nsec_high(unsigned long long nsec) |
35 | { | 35 | { |
36 | if (nsec < 0) { | 36 | if ((long long)nsec < 0) { |
37 | nsec = -nsec; | 37 | nsec = -nsec; |
38 | do_div(nsec, 1000000); | 38 | do_div(nsec, 1000000); |
39 | return -nsec; | 39 | return -nsec; |
@@ -43,9 +43,9 @@ static long long nsec_high(long long nsec) | |||
43 | return nsec; | 43 | return nsec; |
44 | } | 44 | } |
45 | 45 | ||
46 | static unsigned long nsec_low(long long nsec) | 46 | static unsigned long nsec_low(unsigned long long nsec) |
47 | { | 47 | { |
48 | if (nsec < 0) | 48 | if ((long long)nsec < 0) |
49 | nsec = -nsec; | 49 | nsec = -nsec; |
50 | 50 | ||
51 | return do_div(nsec, 1000000); | 51 | return do_div(nsec, 1000000); |