From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH 03/10] xen: sysfs: fix build warning.
Date: Thu, 18 Oct 2012 08:32:02 +0100 [thread overview]
Message-ID: <1350545522.28188.12.camel@dagon.hellion.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.02.1210171800500.2689@kaball.uk.xensource.com>
On Wed, 2012-10-17 at 18:02 +0100, Stefano Stabellini wrote:
> On Wed, 17 Oct 2012, Ian Campbell wrote:
> > Define PRI macros for xen_ulong_t and xen_pfn_t and use to fix:
> > drivers/xen/sys-hypervisor.c:288:4: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'xen_ulong_t' [-Wformat]
> >
> > Ideally this would use PRIx64 on ARM but these (or equivalent) don't
> > seem to be available in the kernel.
>
> I don't think that the PRI macros are used at all in the kernel, so you
> can actually name and define these ones the way you like.
Sure, it's just a bit annoying to have the disconnect between "uint64_t"
and to pair it with "llx" instead of PRIx64. It might almost be better
to have typedef unsigned long long xen_pfn_t et al.
Anyway, lets stick with this for now.
> These definitions seem good to me.
>
>
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> > arch/arm/include/asm/xen/interface.h | 2 ++
> > arch/x86/include/asm/xen/interface.h | 2 ++
> > drivers/xen/sys-hypervisor.c | 3 ++-
> > 3 files changed, 6 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h
> > index ae05e56..62160f2 100644
> > --- a/arch/arm/include/asm/xen/interface.h
> > +++ b/arch/arm/include/asm/xen/interface.h
> > @@ -31,7 +31,9 @@
> > /* Explicitly size integers that represent pfns in the interface with
> > * Xen so that we can have one ABI that works for 32 and 64 bit guests. */
> > typedef uint64_t xen_pfn_t;
> > +#define PRI_xen_pfn "llx"
> > typedef uint64_t xen_ulong_t;
> > +#define PRI_xen_ulong "llx"
> > /* Guest handles for primitive C types. */
> > __DEFINE_GUEST_HANDLE(uchar, unsigned char);
> > __DEFINE_GUEST_HANDLE(uint, unsigned int);
> > diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h
> > index 6d2f75a..ab3c67c 100644
> > --- a/arch/x86/include/asm/xen/interface.h
> > +++ b/arch/x86/include/asm/xen/interface.h
> > @@ -51,7 +51,9 @@
> > * with Xen so that on ARM we can have one ABI that works for 32 and 64
> > * bit guests. */
> > typedef unsigned long xen_pfn_t;
> > +#define PRI_xen_pfn "lx"
> > typedef unsigned long xen_ulong_t;
> > +#define PRI_xen_ulong "lx"
> > /* Guest handles for primitive C types. */
> > __DEFINE_GUEST_HANDLE(uchar, unsigned char);
> > __DEFINE_GUEST_HANDLE(uint, unsigned int);
> > diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
> > index 66a0a14..96453f8 100644
> > --- a/drivers/xen/sys-hypervisor.c
> > +++ b/drivers/xen/sys-hypervisor.c
> > @@ -285,7 +285,8 @@ static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer)
> > ret = HYPERVISOR_xen_version(XENVER_platform_parameters,
> > parms);
> > if (!ret)
> > - ret = sprintf(buffer, "%lx\n", parms->virt_start);
> > + ret = sprintf(buffer, "%"PRI_xen_ulong"\n",
> > + parms->virt_start);
> > kfree(parms);
> > }
> >
> > --
> > 1.7.2.5
> >
next prev parent reply other threads:[~2012-10-18 7:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1350463138.2460.19.camel@zakaz.uk.xensource.com>
2012-10-17 8:39 ` [PATCH 01/10] xen: xenbus: quirk uses x86 specific cpuid Ian Campbell
2012-10-17 8:41 ` Ian Campbell
2012-10-17 9:09 ` Jan Beulich
2012-10-17 14:56 ` Konrad Rzeszutek Wilk
2012-10-17 8:39 ` [PATCH 02/10] xen: sysfs: include err.h for PTR_ERR etc Ian Campbell
2012-10-17 16:59 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 03/10] xen: sysfs: fix build warning Ian Campbell
2012-10-17 17:02 ` Stefano Stabellini
2012-10-18 7:32 ` Ian Campbell [this message]
2012-10-17 8:39 ` [PATCH 04/10] xen: dbgp: Fix warning when CONFIG_PCI is not enabled Ian Campbell
2012-10-17 9:10 ` Jan Beulich
2012-10-17 17:08 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 05/10] xen: events: pirq_check_eoi_map is X86 specific Ian Campbell
2012-10-17 17:06 ` Stefano Stabellini
2012-10-18 7:29 ` Ian Campbell
2012-10-17 8:39 ` [PATCH 06/10] xen: XENMEM_translate_gpfn_list was remove ages ago and is unused Ian Campbell
2012-10-17 8:39 ` [PATCH 07/10] xen: grant: use xen_pfn_t type for frame_list Ian Campbell
2012-10-17 17:10 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 08/10] xen: balloon: don't include e820.h Ian Campbell
2012-10-17 17:35 ` Stefano Stabellini
2012-10-17 8:39 ` [PATCH 09/10] xen: balloon: use correct type for frame_list Ian Campbell
2012-10-17 17:28 ` Stefano Stabellini
2012-10-17 17:32 ` Konrad Rzeszutek Wilk
2012-10-18 7:26 ` Ian Campbell
2012-10-17 8:39 ` [PATCH 10/10] xen: arm: make p2m operations NOPs Ian Campbell
2012-10-17 17:13 ` Stefano Stabellini
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=1350545522.28188.12.camel@dagon.hellion.org.uk \
--to=ian.campbell@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=konrad.wilk@oracle.com \
--cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).