From patchwork Thu Oct 12 13:29:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10001987 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BEED26028A for ; Thu, 12 Oct 2017 13:29:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B04F725F3E for ; Thu, 12 Oct 2017 13:29:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A55E028DD7; Thu, 12 Oct 2017 13:29:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7908B25F3E for ; Thu, 12 Oct 2017 13:29:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68B566E845; Thu, 12 Oct 2017 13:29:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id CB9726E83F; Thu, 12 Oct 2017 13:29:49 +0000 (UTC) Received: by mail-qt0-x242.google.com with SMTP id 1so13593851qtn.3; Thu, 12 Oct 2017 06:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZBgTEgM9AWTpujjmadwIk68IYjtn3Jo/ikFBl7aYkYI=; b=QTPih3x2YhnuV4WT6aFpvo14JFyQ5AyAUQAr/iPzf9Hdrv/vY69l3xbMGaqt881BiN 5OHEj+NpdD0rM1f+8JzuvuFFIJKLmEcExnwx9zRUi3VLi0XABQhesnhBnw4eAn2zMF6C R+K+bb8ON2XBHpGhpCnJIGNZwbr7QYd/F5TeBJwkmT2NZs/z4naHYc/UeaN7/grzTlpX yHx27vuXfSwoeVaFSHxWkf+CqDtnjCQhq2/n88S7iJUR3O7m0u008KW/8OMWSX7pkjBr Cutp7A0/bNgJJSEcmOnBhk6qhvdlKGLYo1vU2+iU5fRNl9rmJLfpq4M7cr6OybHso9dQ xyHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZBgTEgM9AWTpujjmadwIk68IYjtn3Jo/ikFBl7aYkYI=; b=OXqDCn4lj0PciNCG1jUE3y9O60e2ZAR485aStgPXihXqafffxYUN50/NQXypuwtJQW IVbfPp5Zt1mTQOiOLzAChklGOzeMx5c5idI2IxyIfpot0DM3a8sTVqSe6AMJrVOwZUrl Xbzfimm+GU/f+b2/0kPe0SmkucwnLsDerFHXZm3SH1cX7OEAc6DVOuYV5hGucZP3A00A Xt0tFp9imQN1yUf97Eu4J2/05wm4pIX8EwGS/LZbMmUQ1m/UjaPCoiZJBpl3lxFkAW0L 5kSIsHo1cgEhlKbKSNA5xjitLXzR9+yZEvmEd7SNfs3HCBYkrcLHg83R+9YamMrzEUKF StxA== X-Gm-Message-State: AMCzsaUYDwPqKPVrc4DSOzCmS89kE/75Kdw01IoZpr4LNY0Gz/qEl+e4 EKB585kEm/rUyqKUJw+818KGjA== X-Google-Smtp-Source: ABhQp+TjuQG65j2MiXMqci9qH9RMsv82nNSivQHwmiZwhhjxlc6DKI9ssSINCcYX1/EjatLiUDWDpQ== X-Received: by 10.237.48.2 with SMTP id 2mr3394475qte.248.1507814988534; Thu, 12 Oct 2017 06:29:48 -0700 (PDT) Received: from localhost (p200300E41BE4FD00CEAD5B94E1CFD280.dip0.t-ipconnect.de. [2003:e4:1be4:fd00:cead:5b94:e1cf:d280]) by smtp.gmail.com with ESMTPSA id r6sm9688040qkh.22.2017.10.12.06.29.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Oct 2017 06:29:47 -0700 (PDT) From: Thierry Reding To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Oct 2017 15:29:38 +0200 Message-Id: <20171012132943.28316-2-thierry.reding@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171012132943.28316-1-thierry.reding@gmail.com> References: <20171012132943.28316-1-thierry.reding@gmail.com> Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t 2/7] tools/aubdump: Avoid ISO C90 warning 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-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding GCC will warn about ISO C90 forbidding to mix declarations and code. Declare the variable at the beginning of the function to suppress the warning. Signed-off-by: Thierry Reding --- tools/aubdump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/aubdump.c b/tools/aubdump.c index 1aeff5f4532c..6ba3cb66256e 100644 --- a/tools/aubdump.c +++ b/tools/aubdump.c @@ -407,6 +407,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) uint32_t offset = gtt_size(); struct drm_i915_gem_exec_object2 *obj; struct bo *bo, *batch_bo; + int batch_index; void *data; /* We can't do this at open time as we're not yet authenticated. */ @@ -460,7 +461,7 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2) fail_if(bo->map == MAP_FAILED, "intel_aubdump: bo mmap failed\n"); } - int batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 : + batch_index = (execbuffer2->flags & I915_EXEC_BATCH_FIRST) ? 0 : execbuffer2->buffer_count - 1; batch_bo = get_bo(exec_objects[batch_index].handle); for (uint32_t i = 0; i < execbuffer2->buffer_count; i++) {