Bug #2737
closedi386 drm_bufs.c:259:2 '%lx' offset type 'resource_size_t'
0%
Description
i386 GENERIC kernel compilation fails with
/usr/src/sys/dev/drm/drm/../drm_bufs.c: In function 'drm_addmap':
/usr/src/sys/dev/drm/drm/../drm_bufs.c:259:2: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'resource_size_t' [-Werror=format]
cc1: all warnings being treated as errors
Argument offset is type resource_size_t which appears to be vm_paddr_t and thus __unit64_t.
A patch similar to the below fixes compilation problems on i386:
diff --git a/sys/dev/drm/drm_bufs.c b/sys/dev/drm/drm_bufs.c
index 575dbcf..7c66ea8 100644
--- a/sys/dev/drm/drm_bufs.c
+++ b/sys/dev/drm/drm_bufs.c@ -256,7 +256,7
@ int drm_addmap(struct drm_device * dev, resource_size_t offset,
done:
/* Jumped to, with lock held, when a kernel map is found. */
- DRM_DEBUG("Added map %d 0x%lx/0x%lx\n", map->type, map->offset,
+ DRM_DEBUG("Added map %d 0x%lx/0x%lx\n", map->type, (unsigned long)map->offset,
map->size);
*map_ptr = map;