* [PATCH] Fix try_to_freeze_tasks()'s use of do_div()
@ 2008-07-11 13:21 David Howells
2008-07-11 15:05 ` Rafael J. Wysocki
2008-07-11 17:59 ` Pavel Machek
0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2008-07-11 13:21 UTC (permalink / raw)
To: rjw, akpm; +Cc: dhowells, pavel, linux-kernel
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 438e2ce68dfd4af4cfcec2f873564fb921db4bb5.
Signed-off-by: David Howells <dhowells@redhat.com>
---
kernel/power/process.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 5fb8765..278946a 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -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);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix try_to_freeze_tasks()'s use of do_div()
2008-07-11 13:21 [PATCH] Fix try_to_freeze_tasks()'s use of do_div() David Howells
@ 2008-07-11 15:05 ` Rafael J. Wysocki
2008-07-11 17:59 ` Pavel Machek
1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2008-07-11 15:05 UTC (permalink / raw)
To: David Howells; +Cc: akpm, pavel, linux-kernel
On Friday, 11 of July 2008, David Howells wrote:
> 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 438e2ce68dfd4af4cfcec2f873564fb921db4bb5.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
>
> kernel/power/process.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index 5fb8765..278946a 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -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);
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix try_to_freeze_tasks()'s use of do_div()
2008-07-11 13:21 [PATCH] Fix try_to_freeze_tasks()'s use of do_div() David Howells
2008-07-11 15:05 ` Rafael J. Wysocki
@ 2008-07-11 17:59 ` Pavel Machek
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2008-07-11 17:59 UTC (permalink / raw)
To: David Howells; +Cc: rjw, akpm, linux-kernel
On Fri 2008-07-11 14:21:46, David Howells wrote:
> 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 438e2ce68dfd4af4cfcec2f873564fb921db4bb5.
>
> Signed-off-by: David Howells <dhowells@redhat.com>
ACK.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-07-11 17:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-11 13:21 [PATCH] Fix try_to_freeze_tasks()'s use of do_div() David Howells
2008-07-11 15:05 ` Rafael J. Wysocki
2008-07-11 17:59 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®