Skip to content

Commit

Permalink
pm: fix try_to_freeze_tasks()'s use of do_div()
Browse files Browse the repository at this point in the history
Fix try_to_freeze_tasks()'s use of do_div() on an s64 by making
elapsed_csecs64 a u64 instead and dividing that.

Possibly this should be guarded lest the interval calculation turn up
negative, but the possible negativity of the result of the division is
cast away anyway.

This was introduced by patch 438e2ce.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: "Rafael J. Wysocki" <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
David Howells authored and Linus Torvalds committed Jul 24, 2008
1 parent e41fb7c commit f0af566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/power/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int try_to_freeze_tasks(bool sig_only)
unsigned long end_time;
unsigned int todo;
struct timeval start, end;
s64 elapsed_csecs64;
u64 elapsed_csecs64;
unsigned int elapsed_csecs;

do_gettimeofday(&start);
Expand Down

0 comments on commit f0af566

Please sign in to comment.