Re: [PATCH] cpu: Unify CPUID data structures

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

 



> >  src/cpu/cpu_x86.c      |  576 +++++++++++++++++++++--------------------------
> >  src/cpu/cpu_x86_data.h |    4 +-
> >  2 files changed, 259 insertions(+), 321 deletions(-)
> > 
> 
> Nice cleanup.
> 
> ACK.

Thanks, I pushed the patch without any modifications.

> > +
> > +static void
> > +x86DataIteratorInit(struct data_iterator *iter,
> > +                    union cpuData *data)
> > +{
> > +    struct data_iterator init = DATA_ITERATOR_INIT(data);
> > +
> > +    *iter = init;
> 
> Is this any more efficient if init is marked static?

It might be more efficient but it is incorrect as we want to keep
x86DataIteratorInit() reentrant.

> Or can we even bypass the init variable and just do *iter =
> DATA_ITERATOR_INIT(data)?

Unfortunately we can't since it wouldn't compile. We could, however rewrite it
as

    iter->data = data;
    iter->pos = -1;
    iter->extended = false;

I prefer to reuse DATA_ITERATOR_INIT() instead.

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]