summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo Sergio Travaglia <pstglia@gmail.com>2015-06-28 19:16:42 -0300
committerChih-Wei Huang <cwhuang@linux.org.tw>2015-07-26 23:58:28 +0800
commit4c7eccbfd13f1e8c71f7d3c417d2ffe4d853f30b (patch)
treed7f8be443ac823d9c854f8161197baefc431da15
parent613181cff0b76e52f29a655cbbb933f785798731 (diff)
downloadexternal_drm_gralloc-4c7eccbfd13f1e8c71f7d3c417d2ffe4d853f30b.zip
external_drm_gralloc-4c7eccbfd13f1e8c71f7d3c417d2ffe4d853f30b.tar.gz
external_drm_gralloc-4c7eccbfd13f1e8c71f7d3c417d2ffe4d853f30b.tar.bz2
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.
-rw-r--r--gralloc_drm_radeon.c4
1 files 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");