Commit c1de5dc0 authored by Chuck Tuffli's avatar Chuck Tuffli Committed by Adam Jackson
Browse files

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: default avatarChuck Tuffli <chuck@tuffli.net>
parent 8ea3af62
......@@ -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;*/
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment