From 4c7eccbfd13f1e8c71f7d3c417d2ffe4d853f30b Mon Sep 17 00:00:00 2001 From: Paulo Sergio Travaglia Date: Sun, 28 Jun 2015 19:16:42 -0300 Subject: Correct the casting type for radeon drm calls It could be wrong to cast a pointer to a long type (32-bit signed integer) and extend it to a uint64_t (64-bit unsigned integer). Cast it to uintptr_t as the xorg-video-ati does. --- gralloc_drm_radeon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gralloc_drm_radeon.c b/gralloc_drm_radeon.c index 2911a45..8320989 100644 --- a/gralloc_drm_radeon.c +++ b/gralloc_drm_radeon.c @@ -353,7 +353,7 @@ static int radeon_init_tile_config(struct radeon_info *info) memset(&ginfo, 0, sizeof(ginfo)); ginfo.request = RADEON_INFO_TILING_CONFIG; - ginfo.value = (long) &val; + ginfo.value = (uintptr_t) &val; ret = drmCommandWriteRead(info->fd, DRM_RADEON_INFO, &ginfo, sizeof(ginfo)); if (ret) @@ -465,7 +465,7 @@ static int radeon_probe(struct radeon_info *info) memset(&kinfo, 0, sizeof(kinfo)); kinfo.request = RADEON_INFO_DEVICE_ID; - kinfo.value = (long) &info->chipset; + kinfo.value = (uintptr_t) &info->chipset; err = drmCommandWriteRead(info->fd, DRM_RADEON_INFO, &kinfo, sizeof(kinfo)); if (err) { ALOGE("failed to get device id"); -- cgit v1.1