Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 37ea0fcb authored by Ian Campbell's avatar Ian Campbell Committed by Konrad Rzeszutek Wilk
Browse files

xen: sysfs: fix build warning.



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.

Acked-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: default avatarIan Campbell <ian.campbell@citrix.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 609b0b8c
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -31,7 +31,9 @@
/* Explicitly size integers that represent pfns in the interface with
/* 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. */
 * Xen so that we can have one ABI that works for 32 and 64 bit guests. */
typedef uint64_t xen_pfn_t;
typedef uint64_t xen_pfn_t;
#define PRI_xen_pfn "llx"
typedef uint64_t xen_ulong_t;
typedef uint64_t xen_ulong_t;
#define PRI_xen_ulong "llx"
/* Guest handles for primitive C types. */
/* Guest handles for primitive C types. */
__DEFINE_GUEST_HANDLE(uchar, unsigned char);
__DEFINE_GUEST_HANDLE(uchar, unsigned char);
__DEFINE_GUEST_HANDLE(uint,  unsigned int);
__DEFINE_GUEST_HANDLE(uint,  unsigned int);
+2 −0
Original line number Original line Diff line number Diff line
@@ -51,7 +51,9 @@
 * with Xen so that on ARM we can have one ABI that works for 32 and 64
 * with Xen so that on ARM we can have one ABI that works for 32 and 64
 * bit guests. */
 * bit guests. */
typedef unsigned long xen_pfn_t;
typedef unsigned long xen_pfn_t;
#define PRI_xen_pfn "lx"
typedef unsigned long xen_ulong_t;
typedef unsigned long xen_ulong_t;
#define PRI_xen_ulong "lx"
/* Guest handles for primitive C types. */
/* Guest handles for primitive C types. */
__DEFINE_GUEST_HANDLE(uchar, unsigned char);
__DEFINE_GUEST_HANDLE(uchar, unsigned char);
__DEFINE_GUEST_HANDLE(uint,  unsigned int);
__DEFINE_GUEST_HANDLE(uint,  unsigned int);
+2 −1
Original line number Original line Diff line number Diff line
@@ -285,7 +285,8 @@ static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer)
		ret = HYPERVISOR_xen_version(XENVER_platform_parameters,
		ret = HYPERVISOR_xen_version(XENVER_platform_parameters,
					     parms);
					     parms);
		if (!ret)
		if (!ret)
			ret = sprintf(buffer, "%lx\n", parms->virt_start);
			ret = sprintf(buffer, "%"PRI_xen_ulong"\n",
				      parms->virt_start);
		kfree(parms);
		kfree(parms);
	}
	}