public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH i-g-t 2/7] tools/aubdump: Avoid ISO C90 warning
Date: Thu, 12 Oct 2017 15:29:38 +0200	[thread overview]
Message-ID: <20171012132943.28316-2-thierry.reding@gmail.com> (raw)
In-Reply-To: <20171012132943.28316-1-thierry.reding@gmail.com>

From: Thierry Reding <treding@nvidia.com>

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 <treding@nvidia.com>
---
 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++) {
-- 
2.14.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-10-12 13:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 13:29 [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems Thierry Reding
2017-10-12 13:29 ` Thierry Reding [this message]
2017-10-12 13:29 ` [PATCH i-g-t 3/7] lib: Fix compilation on non-x86 Thierry Reding
2017-10-12 13:44   ` Ville Syrjälä
2017-10-12 13:56     ` [Intel-gfx] " Thierry Reding
2017-10-17 22:05   ` Chris Wilson
2017-10-12 13:29 ` [PATCH i-g-t 4/7] lib/drmtest: Fix typo Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 5/7] lib/drmtest: Support nouveau Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 6/7] lib/drmtest: Support Tegra Thierry Reding
2017-10-12 13:29 ` [PATCH i-g-t 7/7] lib/drmtest: Allow the test device to be overridden Thierry Reding
2017-10-12 13:38 ` [PATCH i-g-t 1/7] tests/perf: Fix a bunch of warnings on 32-bit systems Lionel Landwerlin
2017-10-12 13:42 ` Ville Syrjälä
2017-10-12 14:08 ` ✓ Fi.CI.BAT: success for series starting with [1/7] " Patchwork
2017-10-12 19:55 ` ✗ Fi.CI.IGT: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171012132943.28316-2-thierry.reding@gmail.com \
    --to=thierry.reding@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox