Re: [PATCH] cpu: Unify CPUID data structures

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

 



On 12/13/2010 02:06 AM, Jiri Denemark wrote:
> So far, CPUID data were stored in two different data structures. First
> of them was a structure allowing direct access for CPUID data according
> to function number and the second was a plain array of struct
> cpuX86cpuid. This was a silly design which resulted in converting data
> from one type to the other and back again or implementing similar
> functionality for both data structures.
> 
> The patch leaves only the direct access structure. This makes the code
> both smaller and more maintainable since operations on different objects
> can use common low-level operations.
> 
> All 57 tests for cpu subsystem still pass after this rewrite.
> ---
>  src/cpu/cpu_x86.c      |  576 +++++++++++++++++++++--------------------------
>  src/cpu/cpu_x86_data.h |    4 +-
>  2 files changed, 259 insertions(+), 321 deletions(-)
> 

Nice cleanup.

ACK.

> +
> +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?  Or can we even
bypass the init variable and just do *iter = DATA_ITERATOR_INIT(data)?

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
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]