From fdecc1b5afbdcdb20fa98c642cea7fa1dc1a8944 Mon Sep 17 00:00:00 2001 From: Thomas Wood Date: Tue, 8 Sep 2015 17:13:43 +0100 Subject: [PATCH] tools/aubdump: remove void pointer arithmetic A gcc extension allows void pointer arithmetic by treating the size of void as 1, but this generates a warning when -Wpointer-arith is used. Signed-off-by: Thomas Wood --- tools/aubdump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/aubdump.c b/tools/aubdump.c index d52515b4..a17dc10f 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -191,7 +191,7 @@ aub_write_trace_block(uint32_t type, void *virtual, uint32_t size, uint64_t gtt_ dword_out((gtt_offset + offset) >> 32); if (virtual) - data_out(GET_PTR(virtual) + offset, block_size); + data_out(((char *) GET_PTR(virtual)) + offset, block_size); else data_out(null_block, block_size); @@ -261,7 +261,7 @@ relocate_bo(struct bo *bo, const struct drm_i915_gem_execbuffer2 *execbuffer2, else handle = relocs[i].target_handle; - dw = relocated + relocs[i].offset; + dw = (uint32_t*)(((char *) relocated) + relocs[i].offset); *dw = bos[handle].offset + relocs[i].delta; }