diff mbox

[PULL,04/15] vl: Avoid unnecessary 'if' nesting

Message ID 1421228492-19856-5-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Jan. 14, 2015, 9:41 a.m. UTC
From: Eduardo Habkost <ehabkost@redhat.com>

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

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 vl.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox

Patch

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);