From patchwork Tue Sep 8 17:13:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 7142891 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4E1749F32B for ; Tue, 8 Sep 2015 17:22:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 51A1D2089B for ; Tue, 8 Sep 2015 17:22:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0927520676 for ; Tue, 8 Sep 2015 17:22:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7378D6E1A4; Tue, 8 Sep 2015 10:22:21 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D9546E1A4 for ; Tue, 8 Sep 2015 10:22:20 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 08 Sep 2015 10:22:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,491,1437462000"; d="scan'208";a="557696166" Received: from otc-vmt1.isw.intel.com ([10.237.224.80]) by FMSMGA003.fm.intel.com with ESMTP; 08 Sep 2015 10:22:18 -0700 From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Tue, 8 Sep 2015 18:13:03 +0100 Message-Id: <1441732384-11633-1-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.1 Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ Subject: [Intel-gfx] [PATCH i-g-t 1/2] tools/aubdump: remove void pointer arithmetic X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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; }