]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
lockstat: fixup signed division
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Tue, 23 Sep 2008 13:33:41 +0000 (15:33 +0200)
committerIngo Molnar <mingo@elte.hu>
Tue, 23 Sep 2008 14:19:37 +0000 (16:19 +0200)
Some recent modification to this code made me notice the little todo mark.
Now that we have more elaborate 64-bit division functions this isn't hard.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/lockdep_proc.c

index 20dbcbf9c7dd2cf34486f3e9f307f1e3cf8a97bc..8d3a6eba8d5af7405f3d57c958c9b51f5d22689a 100644 (file)
@@ -470,11 +470,12 @@ static void seq_line(struct seq_file *m, char c, int offset, int length)
 
 static void snprint_time(char *buf, size_t bufsiz, s64 nr)
 {
-       unsigned long rem;
+       s64 div;
+       s32 rem;
 
        nr += 5; /* for display rounding */
-       rem = do_div(nr, 1000); /* XXX: do_div_signed */
-       snprintf(buf, bufsiz, "%lld.%02d", (long long)nr, (int)rem/10);
+       div = div_s64_rem(nr, 1000, &rem);
+       snprintf(buf, bufsiz, "%lld.%02d", (long long)div, (int)rem/10);
 }
 
 static void seq_time(struct seq_file *m, s64 time)