From ee307799f3da7aa43e44461e0270a477f15e2356 Mon Sep 17 00:00:00 2001 From: lucaswei Date: Tue, 10 Nov 2020 01:30:25 +0800 Subject: [PATCH] video: hfi_iris2: Fix -Wpointer-to-int-cast msm/vidc/hfi_iris2.c:170:3: error: cast to smaller integer type 'u32' (aka 'unsigned int') from 'u8 *' (aka 'unsigned char *') [-Werror,-Wpointer-to-int-cast] (u32)device->iface_q_table.align_virtual_addr, sid); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Casting `device->iface_q_table.align_virtual_addr` to uintptr_t first, then cast to u32 to avoid pointer-to-int-cast errors. Bug: 171827315 Bug: 181191123 Signed-off-by: lucaswei Change-Id: I687af3df978841d4cba8ea658176187d1fb56837 --- techpack/video/msm/vidc/hfi_iris2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/techpack/video/msm/vidc/hfi_iris2.c b/techpack/video/msm/vidc/hfi_iris2.c index 5ac62b788ea4..41428248de2a 100644 --- a/techpack/video/msm/vidc/hfi_iris2.c +++ b/techpack/video/msm/vidc/hfi_iris2.c @@ -2,6 +2,7 @@ /* * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. */ +#include #include "msm_vidc_debug.h" #include "hfi_common.h" @@ -167,9 +168,9 @@ void __setup_ucregion_memory_map_iris2(struct venus_hfi_device *device, u32 sid) (u32)device->qdss.align_device_addr, sid); /* update queues vaddr for debug purpose */ __write_register(device, CPU_CS_VCICMDARG0_IRIS2, - (u32)device->iface_q_table.align_virtual_addr, sid); + (u32)((uintptr_t)device->iface_q_table.align_virtual_addr & UINT_MAX), sid); __write_register(device, CPU_CS_VCICMDARG1_IRIS2, - (u32)((u64)device->iface_q_table.align_virtual_addr >> 32), + (u32)((uintptr_t)device->iface_q_table.align_virtual_addr >> 32), sid); }