[libvirt] [PATCH 2/8] cpu: Make comparing PowerPC CPUs easier to read

Eric Blake eblake at redhat.com
Sat Dec 22 04:35:19 UTC 2012


On 12/20/2012 05:01 PM, Jiri Denemark wrote:
> Revert the condition to make it easier to read. The function is also

s/Revert/Invert/

> renamed as ppcCompare to match other functions in PowerPC CPU driver.
> ---

>  src/cpu/cpu_powerpc.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> -    if ((cpu->arch != VIR_ARCH_NONE &&
> -         (host->arch != cpu->arch)) ||
> -        STRNEQ(host->model, cpu->model))
> -        return VIR_CPU_COMPARE_INCOMPATIBLE;
> +    if ((cpu->arch == VIR_ARCH_NONE || host->arch == cpu->arch) &&
> +        STREQ(host->model, cpu->model))
> +        return VIR_CPU_COMPARE_IDENTICAL;
>  
> -    return VIR_CPU_COMPARE_IDENTICAL;
> +    return VIR_CPU_COMPARE_INCOMPATIBLE;

Took me a bit, but I agree that deMorgan's law was properly followed and
the logic is unchanged.

ACK.

-- 
-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121221/d65c2e92/attachment-0001.sig>


More information about the libvir-list mailing list