[i-g-t,1/2] tools/aubdump: remove void pointer arithmetic
diff mbox

Message ID 1441732384-11633-1-git-send-email-thomas.wood@intel.com
State New
Headers show

Commit Message

Thomas Wood Sept. 8, 2015, 5:13 p.m. UTC
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 <thomas.wood@intel.com>
---
 tools/aubdump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch
diff mbox

diff --git a/tools/aubdump.c b/tools/aubdump.c
index d52515b..a17dc10 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;
 	}