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 <lucaswei@google.com>
Change-Id: I687af3df978841d4cba8ea658176187d1fb56837
This commit is contained in:
lucaswei 2020-11-10 01:30:25 +08:00 committed by Michael Bestas
parent d877019ecf
commit ee307799f3
No known key found for this signature in database
GPG Key ID: CC95044519BE6669

View File

@ -2,6 +2,7 @@
/* /*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
*/ */
#include <linux/kernel.h>
#include "msm_vidc_debug.h" #include "msm_vidc_debug.h"
#include "hfi_common.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); (u32)device->qdss.align_device_addr, sid);
/* update queues vaddr for debug purpose */ /* update queues vaddr for debug purpose */
__write_register(device, CPU_CS_VCICMDARG0_IRIS2, __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, __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); sid);
} }