Building libpciaccess generates a warning on versions of Linux in which the definition of the struct mtrr_sentry has changed to __u64.
Since sentry.base is assigned from a pciaddr_t, always cast sentry.base to be type pciaddr_t and modify the formatting string to use PRIx64 instead of %08lx Verified on Ubuntu 10.04 and 14.04 Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=74643 Signed-off-by: Chuck Tuffli <[email protected]> --- src/linux_sysfs.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index 97fcf36..8ae22b2 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -589,8 +589,8 @@ pci_device_linux_sysfs_map_range(struct pci_device *dev, /* FIXME: Should we report an error in this case? */ fprintf(stderr, "error setting MTRR " - "(base = 0x%08lx, size = 0x%08x, type = %u) %s (%d)\n", - sentry.base, sentry.size, sentry.type, + "(base = 0x%016" PRIx64 ", size = 0x%08x, type = %u) %s (%d)\n", + (pciaddr_t)sentry.base, sentry.size, sentry.type, strerror(errno), errno); /* err = errno;*/ } @@ -664,8 +664,8 @@ pci_device_linux_sysfs_unmap_range(struct pci_device *dev, /* FIXME: Should we report an error in this case? */ fprintf(stderr, "error setting MTRR " - "(base = 0x%08lx, size = 0x%08x, type = %u) %s (%d)\n", - sentry.base, sentry.size, sentry.type, + "(base = 0x%016" PRIx64 ", size = 0x%08x, type = %u) %s (%d)\n", + (pciaddr_t)sentry.base, sentry.size, sentry.type, strerror(errno), errno); /* err = errno;*/ } -- 1.7.0.4 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
