Skip to content

Commit

Permalink
vl: Avoid unnecessary 'if' nesting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ehabkost authored and bonzini committed Jan 9, 2015
1 parent 4d91558 commit 719cac1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions vl.c
Expand Up @@ -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);
Expand Down

0 comments on commit 719cac1

Please sign in to comment.