From: Sasha Levin <levinsasha928@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: penberg@kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com,
prasadjoshi124@gmail.com, kvm@vger.kernel.org
Subject: Re: [PATCH 2/2] kvm tools: Protect from dup definitions in kernel header
Date: Tue, 03 May 2011 22:56:35 +0300 [thread overview]
Message-ID: <1304452595.13143.3.camel@lappy> (raw)
In-Reply-To: <20110503194915.GB23144@elte.hu>
On Tue, 2011-05-03 at 21:49 +0200, Ingo Molnar wrote:
> * Sasha Levin <levinsasha928@gmail.com> wrote:
>
> > The local kernel.h may redefine macros already
> > defined otherwise, wrap it with #ifdef.
> >
> > Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> > ---
> > 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.
--
Sasha.
next prev parent reply other threads:[~2011-05-03 19:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-03 15:37 [PATCH 1/2] kvm tools: Fix virt_queue__set_used_elem Sasha Levin
2011-05-03 15:37 ` [PATCH 2/2] kvm tools: Protect from dup definitions in kernel header Sasha Levin
2011-05-03 19:49 ` Ingo Molnar
2011-05-03 19:56 ` Sasha Levin [this message]
2011-05-03 19:59 ` Ingo Molnar
2011-05-03 20:10 ` Cyrill Gorcunov
2011-05-03 20:27 ` Cyrill Gorcunov
2011-05-03 19:44 ` [PATCH 1/2] kvm tools: Fix virt_queue__set_used_elem Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1304452595.13143.3.camel@lappy \
--to=levinsasha928@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox