From: Wei Liu <wei.liu2@citrix.com>
To: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
Wei Liu <wei.liu2@citrix.com>,
Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
Subject: Re: [PATCH v2] libs/gnttab: introduce XENGNTTAB_BUILD_BUG_ON
Date: Mon, 19 Sep 2016 13:52:10 +0100 [thread overview]
Message-ID: <20160919125210.GE30319@citrix.com> (raw)
In-Reply-To: <22495.52987.311140.918966@mariner.uk.xensource.com>
On Mon, Sep 19, 2016 at 12:41:47PM +0100, Ian Jackson wrote:
> Wei Liu writes ("[PATCH v2] libs/gnttab: introduce XENGNTTAB_BUILD_BUG_ON"):
> > The implementation is taken from libxc.
> ...
> > I could have put it in a header file accessible to all libraries under
> > libs but this construct is only relevant to xengnttab library at the
> > moment so it's put under gnttab/private.h. It can be easily moved to
> > a common place when other libraries under libs require it.
>
> Other bits of tools already have this:
>
> mariner:xen.git> git-grep -i 'define.*build_bug' tools | cat
> tools/firmware/hvmloader/util.h:#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)]))
> tools/libxc/xc_private.h:#define XC_BUILD_BUG_ON(p) ({ _Static_assert(!(p), "!(" #p ")"); })
> tools/libxc/xc_private.h:#define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); }))
> tools/libxl/libxl_internal.h:#define BUILD_BUG_ON(p) ({ _Static_assert(!(p), "!(" #p ")"); })
> tools/libxl/libxl_internal.h:#define BUILD_BUG_ON(p) ((void)sizeof(char[1 - 2 * !!(p)]))
> mariner:xen.git>
>
> Do we really need to introduce yet another copy of this ? Is gnttab
> not allowed to include xc_private.h ? Is there not some one place
> where we could put this ?
>
AIUI BUILD_BUG_ON is a private thing to each library, hence the
duplication. But I'm fine with having a central header for that, too.
If we want to share that macro across all libraries, we can create a
tools/include/private.h. But that would require a fair bit of work --
adjust xen build system, fix stubdom build, fix mini-os etc -- which I
think it would be best to leave to me.
In the meantime, we should unblock Paulina on this one so that her
project can move forward.
Wei.
> Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-09-19 12:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-04 9:42 [PATCH v2] libs/gnttab: introduce XENGNTTAB_BUILD_BUG_ON Wei Liu
2016-09-19 11:41 ` Ian Jackson
2016-09-19 12:52 ` Wei Liu [this message]
2016-09-19 13:49 ` Ian Jackson
2016-09-19 13:55 ` Wei Liu
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=20160919125210.GE30319@citrix.com \
--to=wei.liu2@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=paulinaszubarczyk@gmail.com \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.