Skip to contentSkip to conversation

sched: Use swap() macro on scale_stime()

PATCH New Stanislaw Gruszka 2 participants 2 messages May 2, 2013 – May 28, 2013 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: Use swap() macro on scale_stime()

---
 kernel/sched/cputime.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/sched/cputime.c +2 -3
index cc2dc3e..94691bc 100644
@@ -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)
Signature · 1 line
1.7.11.7
#1 lore raw

[tip:sched/core] sched: Use swap() macro in scale_stime()

sched: Use swap() macro in scale_stime()
Commit-ID:  84f9f3a15611536537d59060818a2354d5039ff3
Gitweb:     http://git.kernel.org/tip/84f9f3a15611536537d59060818a2354d5039ff3
Author:     Stanislaw Gruszka <[email protected]>
AuthorDate: Thu, 2 May 2013 15:34:33 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 28 May 2013 11:58:10 +0200

sched: Use swap() macro in scale_stime()

Simple cleanup.

---
 kernel/sched/cputime.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
kernel/sched/cputime.c +2 -3
index cc2dc3e..94691bc 100644
@@ -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)