qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 04/15] vl: Avoid unnecessary 'if' nesting


From: Paolo Bonzini
Subject: [Qemu-devel] [PULL 04/15] vl: Avoid unnecessary 'if' nesting
Date: Wed, 14 Jan 2015 10:41:21 +0100

From: Eduardo Habkost <address@hidden>

Just a coding style change, to make other changes easier to review.

Signed-off-by: Eduardo Habkost <address@hidden>
Reviewed-by: Andrew Jones <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 vl.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/vl.c b/vl.c
index 1a2da2b..56a17dd 100644
--- a/vl.c
+++ b/vl.c
@@ -1170,13 +1170,11 @@ static void smp_parse(QemuOpts *opts)
             if (cpus == 0) {
                 cpus = cores * threads * sockets;
             }
+        } else if (cores == 0) {
+            threads = threads > 0 ? threads : 1;
+            cores = cpus / (sockets * threads);
         } else {
-            if (cores == 0) {
-                threads = threads > 0 ? threads : 1;
-                cores = cpus / (sockets * threads);
-            } else {
-                threads = cpus / (cores * sockets);
-            }
+            threads = cpus / (cores * sockets);
         }
 
         max_cpus = qemu_opt_get_number(opts, "maxcpus", 0);
-- 
1.8.3.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]