Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6918bc5c authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

lockstat: fixup signed division



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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 9b9b181c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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)