Re: [RFC PATCH 05/16] kvm tools: don't bother including linux/compiler.h

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

 



On Mon, 12 Nov 2012, Will Deacon wrote:

> linux/compiler.h will never give us a definition for __compiler_offsetof
> because __KERNEL__ isn't defined, so just use the simple definition that
> we have already.
> 
> This patch removes the redundant code.
> 
> Signed-off-by: Will Deacon <will.deacon@xxxxxxx>
> ---
>  tools/kvm/include/linux/stddef.h |    6 ------
>  1 files changed, 0 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/kvm/include/linux/stddef.h b/tools/kvm/include/linux/stddef.h
> index 60ea512..39da808 100644
> --- a/tools/kvm/include/linux/stddef.h
> +++ b/tools/kvm/include/linux/stddef.h
> @@ -1,16 +1,10 @@
>  #ifndef _LINUX_STDDEF_H
>  #define _LINUX_STDDEF_H
>  
> -#include <linux/compiler.h>
> -
>  #undef NULL
>  #define NULL ((void *)0)
>  
>  #undef offsetof
> -#ifdef __compiler_offsetof
> -#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
> -#else
>  #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
> -#endif
>  
>  #endif

I'm seeing the following breakage with this patch applied:

[penberg@tux kvm]$ make
  CC       hw/rtc.o
  CC       ioport.o
  CC       kvm-cpu.o
  CC       kvm.o
In file included from include/kvm/rbtree-interval.h:4:0,
                 from include/kvm/ioport.h:4,
                 from hw/rtc.c:3:
../../include/linux/rbtree_augmented.h:125:24: error: expected ʽ=ʼ, ʽ,ʼ, ʽ;ʼ, ʽasmʼ or ʽ__attribute__ʼ before ʽvoidʼ
In file included from include/kvm/rbtree-interval.h:4:0,
                 from include/kvm/ioport.h:4,
                 from ioport.c:1:
../../include/linux/rbtree_augmented.h:125:24: error: expected ʽ=ʼ, ʽ,ʼ, ʽ;ʼ, ʽasmʼ or ʽ__attribute__ʼ before ʽvoidʼ
make: *** [hw/rtc.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [ioport.o] Error 1

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux