Re: [PATCH 2/4] cpu: Better support for ppc64 compatibility modes

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

 



On Fri, Aug 21, 2015 at 14:55:02 -0700, Andrea Bolognani wrote:
> On Fri, 2015-08-21 at 14:27 -0700, Jiri Denemark wrote:
> 
> > > +static virCPUCompareResult
> > > +ppc64CheckCompatibilityMode(const char *host_model,
> > > +                            const char *compat_mode)
> > > +{
> > > +    int host;
> > > +    int compat;
> > > +    char *tmp;
> > > +    virCPUCompareResult ret = VIR_CPU_COMPARE_IDENTICAL;
> > 
> > Shouldn't ret be initialized to VIR_CPU_COMPARE_ERROR so that we
> > don't
> > report everything is OK on errors?
> 
> Initializing it to VIR_CPU_COMPARE_IDENTICAL allows us to
> just jump to the exit point if a compatibility mode is not
> used (see check right below).
> 
> That could be replaced with an explicit return if you
> think that would make the code easier to understand.

Oops, I'm blind, I completely missed the "ret = VIR_CPU_COMPARE_ERROR"
after the check. But yes, I think initializing to *_ERROR and an
explicit return if compatibility mode is not used would be more
readable.

Jirka

--
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]