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

* [tip:sched/core] sched: Use swap() macro in scale_stime()
  2013-05-02 13:34 [PATCH -tip] sched: Use swap() macro on scale_stime() Stanislaw Gruszka
@ 2013-05-28 13:37 ` tip-bot for Stanislaw Gruszka
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Stanislaw Gruszka @ 2013-05-28 13:37 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, peterz, tglx, sgruszka

Commit-ID:  84f9f3a15611536537d59060818a2354d5039ff3
Gitweb:     http://git.kernel.org/tip/84f9f3a15611536537d59060818a2354d5039ff3
Author:     Stanislaw Gruszka <sgruszka@redhat.com>
AuthorDate: Thu, 2 May 2013 15:34:33 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 28 May 2013 11:58:10 +0200

sched: Use swap() macro in scale_stime()

Simple cleanup.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/1367501673-6563-1-git-send-email-sgruszka@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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)

^ 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®