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

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

 



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

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]