Re: [PATCH 2/2] kvm tools: Protect from dup definitions in kernel header

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

 



* Sasha Levin <levinsasha928@xxxxxxxxx> wrote:

> On Tue, 2011-05-03 at 21:49 +0200, Ingo Molnar wrote:
> > * Sasha Levin <levinsasha928@xxxxxxxxx> wrote:
> > 
> > > The local kernel.h may redefine macros already
> > > defined otherwise, wrap it with #ifdef.
> > > 
> > > Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx>
> > > ---
> > >  tools/kvm/include/linux/kernel.h |    7 +++++++
> > >  1 files changed, 7 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/tools/kvm/include/linux/kernel.h b/tools/kvm/include/linux/kernel.h
> > > index 8d83037..fccb624 100644
> > > --- a/tools/kvm/include/linux/kernel.h
> > > +++ b/tools/kvm/include/linux/kernel.h
> > > @@ -1,10 +1,17 @@
> > >  #ifndef KVM__LINUX_KERNEL_H_
> > >  #define KVM__LINUX_KERNEL_H_
> > >  
> > > +#ifndef DIV_ROUND_UP
> > >  #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
> > > +#endif
> > >  
> > > +#ifndef ALIGN
> > >  #define ALIGN(x,a)		__ALIGN_MASK(x,(typeof(x))(a)-1)
> > > +#endif
> > > +
> > > +#ifndef __ALIGN_MASK
> > >  #define __ALIGN_MASK(x,mask)	(((x)+(mask))&~(mask))
> > > +#endif
> > 
> > Hm, how can duplicate definitions happen? Only one place should define them - 
> > otherwise we might end up with incompatible definitions ...
> 
> We has ALIGN defined in include/kvm/bios.h within our code.

Well, but then the right solution would be to not define it there but remove 
it, and use the one we get from the kernel headers?

Thanks,

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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