summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuck Tuffli <chuck@tuffli.net>2014-02-06 18:09:35 -0800
committerAdam Jackson <ajax@redhat.com>2015-10-20 14:38:34 -0400
commitc1de5dc0541e58372dcddc5120e1e68e03f4f619 (patch)
tree575f1ef728c72d1c90288c821344a6d0507aaf24
parent8ea3af620a2d4ad5648917b4a0ef2b23ff566774 (diff)
libpciaccess: Fix incorrect format specification
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 <chuck@tuffli.net>
-rw-r--r--src/linux_sysfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
index 5a59bd8..6367b11 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -593,8 +593,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;*/
}
@@ -668,8 +668,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;*/
}