mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -tip] sched: Use swap() macro on scale_stime()
@ 2013-05-02 13:34 Stanislaw Gruszka
  2013-05-28 13:37 ` [tip:sched/core] sched: Use swap() macro in scale_stime() tip-bot for Stanislaw Gruszka
  0 siblings, 1 reply; 2+ messages in thread
From: Stanislaw Gruszka @ 2013-05-02 13:34 UTC (permalink / raw)
  To: Ingo Molnar, Peter Zijlstra
  Cc: Frederic Weisbecker, hpa, tglx, linux-kernel, Stanislaw Gruszka

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 kernel/sched/cputime.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index cc2dc3e..94691bc 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -515,9 +515,8 @@ static cputime_t scale_stime(u64 stime, u64 rtime, u64 total)
 
 	for (;;) {
 		/* Make sure "rtime" is the bigger of stime/rtime */
-		if (stime > rtime) {
-			u64 tmp = rtime; rtime = stime; stime = tmp;
-		}
+		if (stime > rtime)
+			swap(rtime, stime);
 
 		/* Make sure 'total' fits in 32 bits */
 		if (total >> 32)
-- 
1.7.11.7


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-28 13:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-02 13:34 [PATCH -tip] sched: Use swap() macro on scale_stime() Stanislaw Gruszka
2013-05-28 13:37 ` [tip:sched/core] sched: Use swap() macro in scale_stime() tip-bot for Stanislaw Gruszka

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®