]> git.proxmox.com Git - mirror_qemu.git/commit
exec.c: get nodes_nb_alloc with one MAX calculation
authorWei Yang <richardw.yang@linux.intel.com>
Thu, 21 Mar 2019 08:25:52 +0000 (16:25 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Sep 2019 10:32:20 +0000 (12:32 +0200)
commitc95cfd040078db8017f74fd3a4d6f798385d960c
tree42212776fe9a05bd0c2feb4c963985c95ef90e5f
parent56b15076805a29673c1a90ea9c3ebef25bfcc912
exec.c: get nodes_nb_alloc with one MAX calculation

The purpose of these two MAX here is to get the maximum of these three
variables:

    A: map->nodes_nb + nodes
    B: map->nodes_nb_alloc
    C: alloc_hint

We can write it like MAX(A, B, C). Since the if condition says A > B,
this means MAX(A, B, C) = MAX(A, C).

This patch just simplify the calculation a bit.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
Message-Id: <20190321082555.21118-4-richardw.yang@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
exec.c