public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] perf_pmu: Fix some compile warnings with old compilers / 32-bit builds
@ 2018-02-19 10:04 Tvrtko Ursulin
  2018-02-19 10:12 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Tvrtko Ursulin @ 2018-02-19 10:04 UTC (permalink / raw)
  To: igt-dev; +Cc: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Correct printf format for uint64_t and one "may be uninitialized".

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/perf_pmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 82053416cbea..8d8dbe397df6 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -300,7 +300,7 @@ busy_double_start(int gem_fd, const struct intel_execution_engine2 *e)
 	usleep(batch_duration_ns / 1000);
 	val2 = pmu_read_single(fd) - val2;
 
-	igt_info("busy=%lu idle=%lu\n", val, val2);
+	igt_info("busy=%"PRIu64" idle=%"PRIu64"\n", val, val2);
 
 	igt_spin_batch_free(gem_fd, spin[0]);
 	igt_spin_batch_free(gem_fd, spin[1]);
@@ -340,11 +340,11 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 {
 	const struct intel_execution_engine2 *e_;
 	uint64_t tval[2][num_engines];
+	unsigned int busy_idx = 0, i;
 	uint64_t val[num_engines];
 	int fd[num_engines];
 	unsigned long slept;
 	igt_spin_t *spin;
-	unsigned int busy_idx, i;
 
 	i = 0;
 	fd[0] = -1;
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH i-g-t] perf_pmu: Fix some compile warnings with old compilers / 32-bit builds
  2018-02-19 10:04 [PATCH i-g-t] perf_pmu: Fix some compile warnings with old compilers / 32-bit builds Tvrtko Ursulin
@ 2018-02-19 10:12 ` Chris Wilson
  2018-02-19 10:17   ` [PATCH i-g-t v2] " Tvrtko Ursulin
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2018-02-19 10:12 UTC (permalink / raw)
  To: Tvrtko Ursulin, igt-dev; +Cc: Intel-gfx

Quoting Tvrtko Ursulin (2018-02-19 10:04:08)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> Correct printf format for uint64_t and one "may be uninitialized".
> 
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Reported-by: Chris Wilson <chris@chris-wilson.co.uk>

Fixing those two turned up one more!

In file included from ./../lib/igt.h:40:0,
                 from perf_pmu.c:40:
perf_pmu.c: In function ‘__real_main1547’:
./../lib/igt_gt.h:111:2: warning: ‘render_fd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
perf_pmu.c:1761:7: note: ‘render_fd’ was declared here

This compiler is easily confused by longjmps

@@ -1758,7 +1758,7 @@ igt_main
         * Check render nodes are counted.
         */
        igt_subtest_group {
-               int render_fd;
+               int render_fd = -1;
 
Throw that in on top and have a 
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH i-g-t v2] perf_pmu: Fix some compile warnings with old compilers / 32-bit builds
  2018-02-19 10:12 ` Chris Wilson
@ 2018-02-19 10:17   ` Tvrtko Ursulin
  0 siblings, 0 replies; 3+ messages in thread
From: Tvrtko Ursulin @ 2018-02-19 10:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Correct printf format for uint64_t and one "may be uninitialized".

v2: Fix one more "may be uninitialized". (Chris Wilson)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/perf_pmu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 82053416cbea..bed4c257013d 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -300,7 +300,7 @@ busy_double_start(int gem_fd, const struct intel_execution_engine2 *e)
 	usleep(batch_duration_ns / 1000);
 	val2 = pmu_read_single(fd) - val2;
 
-	igt_info("busy=%lu idle=%lu\n", val, val2);
+	igt_info("busy=%"PRIu64" idle=%"PRIu64"\n", val, val2);
 
 	igt_spin_batch_free(gem_fd, spin[0]);
 	igt_spin_batch_free(gem_fd, spin[1]);
@@ -340,11 +340,11 @@ busy_check_all(int gem_fd, const struct intel_execution_engine2 *e,
 {
 	const struct intel_execution_engine2 *e_;
 	uint64_t tval[2][num_engines];
+	unsigned int busy_idx = 0, i;
 	uint64_t val[num_engines];
 	int fd[num_engines];
 	unsigned long slept;
 	igt_spin_t *spin;
-	unsigned int busy_idx, i;
 
 	i = 0;
 	fd[0] = -1;
@@ -1758,7 +1758,7 @@ igt_main
 	 * Check render nodes are counted.
 	 */
 	igt_subtest_group {
-		int render_fd;
+		int render_fd = -1;
 
 		igt_fixture {
 			render_fd = drm_open_driver_render(DRIVER_INTEL);
-- 
2.14.1

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-19 10:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-19 10:04 [PATCH i-g-t] perf_pmu: Fix some compile warnings with old compilers / 32-bit builds Tvrtko Ursulin
2018-02-19 10:12 ` Chris Wilson
2018-02-19 10:17   ` [PATCH i-g-t v2] " Tvrtko Ursulin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox