_csched_cpu_pick(): simplify sched_smt_power_savings dependent condition
authorJan Beulich <jbeulich@novell.com>
Mon, 14 Mar 2011 17:20:11 +0000 (17:20 +0000)
committerJan Beulich <jbeulich@novell.com>
Mon, 14 Mar 2011 17:20:11 +0000 (17:20 +0000)
At least to me, using ?: instead of the (a && ...) || (!a && ...)
construct is far easier to grok with a single look.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/common/sched_credit.c

index 1d4d4236202e7419e8eae9a687ffd7aadac543bf..f1e969499fc49b3acc1535b312c5ca6cef82f713 100644 (file)
@@ -526,10 +526,9 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
         weight_cpu = cpus_weight(cpu_idlers);
         weight_nxt = cpus_weight(nxt_idlers);
         /* smt_power_savings: consolidate work rather than spreading it */
-        if ( ( sched_smt_power_savings
-               && (weight_cpu > weight_nxt) )
-             || ( !sched_smt_power_savings
-                  && (weight_cpu * migrate_factor < weight_nxt) ) )
+        if ( sched_smt_power_savings ?
+             weight_cpu > weight_nxt :
+             weight_cpu * migrate_factor < weight_nxt )
         {
             cpus_and(nxt_idlers, cpus, nxt_idlers);
             spc = CSCHED_PCPU(nxt);