Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

authored by

Ian Campbell and committed by
Konrad Rzeszutek Wilk
37ea0fcb 609b0b8c

+6 -1
+2
arch/arm/include/asm/xen/interface.h
··· 31 31 /* Explicitly size integers that represent pfns in the interface with 32 32 * Xen so that we can have one ABI that works for 32 and 64 bit guests. */ 33 33 typedef uint64_t xen_pfn_t; 34 + #define PRI_xen_pfn "llx" 34 35 typedef uint64_t xen_ulong_t; 36 + #define PRI_xen_ulong "llx" 35 37 /* Guest handles for primitive C types. */ 36 38 __DEFINE_GUEST_HANDLE(uchar, unsigned char); 37 39 __DEFINE_GUEST_HANDLE(uint, unsigned int);
+2
arch/x86/include/asm/xen/interface.h
··· 51 51 * with Xen so that on ARM we can have one ABI that works for 32 and 64 52 52 * bit guests. */ 53 53 typedef unsigned long xen_pfn_t; 54 + #define PRI_xen_pfn "lx" 54 55 typedef unsigned long xen_ulong_t; 56 + #define PRI_xen_ulong "lx" 55 57 /* Guest handles for primitive C types. */ 56 58 __DEFINE_GUEST_HANDLE(uchar, unsigned char); 57 59 __DEFINE_GUEST_HANDLE(uint, unsigned int);
+2 -1
drivers/xen/sys-hypervisor.c
··· 285 285 ret = HYPERVISOR_xen_version(XENVER_platform_parameters, 286 286 parms); 287 287 if (!ret) 288 - ret = sprintf(buffer, "%lx\n", parms->virt_start); 288 + ret = sprintf(buffer, "%"PRI_xen_ulong"\n", 289 + parms->virt_start); 289 290 kfree(parms); 290 291 } 291 292