All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 1/7] Fix a bunch of printf types
Date: Mon, 14 Dec 2015 22:15:50 +0200	[thread overview]
Message-ID: <1450124156-12679-1-git-send-email-ville.syrjala@linux.intel.com> (raw)

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

igt_kms.c: In function ‘igt_crtc_set_background’:
igt_kms.c:1940:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat=]
  LOG(display, "%s.%d: crtc_set_background(%lu)\n",
  ^
intel_firmware_decode.c: In function ‘csr_open’:
intel_firmware_decode.c:169:2: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘__off_t’ [-Wformat=]
  printf("Firmware: %s (%zd bytes)\n", filename, st.st_size);
  ^
intel_gpu_top.c: In function ‘main’:
intel_gpu_top.c:683:10: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=]
          stats[i] - last_stats[i]);
          ^
hsw_compute_wrpll.c: In function ‘main’:
hsw_compute_wrpll.c:644:3: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘long long int’ [-Wformat=]
   igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p,
   ^
gem_gtt_hog.c: In function ‘__real_main155’:
gem_gtt_hog.c:177:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  igt_info("Time to execute %lu children:  %7.3fms\n",
  ^
kms_flip.c: In function ‘run_test_step’:
kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 10 has type ‘__time_t’ [-Wformat=]
   igt_assert_f(end - start > 0.9 * frame_time(o) &&
   ^
kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 11 has type ‘__suseconds_t’ [-Wformat=]
kms_frontbuffer_tracking.c: In function ‘setup_sink_crc’:
kms_frontbuffer_tracking.c:1364:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ [-Wformat=]
   igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n",
   ^
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 lib/igt_kms.c                    |  2 +-
 tests/gem_gtt_hog.c              |  2 +-
 tests/kms_flip.c                 | 20 ++++++++++----------
 tests/kms_frontbuffer_tracking.c |  2 +-
 tools/hsw_compute_wrpll.c        |  2 +-
 tools/intel_firmware_decode.c    |  3 ++-
 tools/intel_gpu_top.c            |  2 +-
 7 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 5d5a95c20106..497118afe52a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1937,7 +1937,7 @@ void igt_crtc_set_background(igt_pipe_t *pipe, uint64_t background)
 {
 	igt_display_t *display = pipe->display;
 
-	LOG(display, "%s.%d: crtc_set_background(%lu)\n",
+	LOG(display, "%s.%d: crtc_set_background(%"PRIx64")\n",
 	    kmstest_pipe_name(pipe->pipe),
 	    pipe->pipe, background);
 
diff --git a/tests/gem_gtt_hog.c b/tests/gem_gtt_hog.c
index 7ca7d12d96f1..365b43ee44ab 100644
--- a/tests/gem_gtt_hog.c
+++ b/tests/gem_gtt_hog.c
@@ -174,6 +174,6 @@ igt_simple_main
 	igt_waitchildren();
 	gettimeofday(&end, NULL);
 
-	igt_info("Time to execute %lu children:		%7.3fms\n",
+	igt_info("Time to execute %zu children:		%7.3fms\n",
 		 ARRAY_SIZE(children), elapsed(&start, &end) / 1000);
 }
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index a3acc3dd28e8..750a1882dc3c 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -132,11 +132,11 @@ struct event_state {
 static void dump_event_state(const struct event_state *es)
 {
 	igt_debug("name = %s\n"
-		  "last_ts = %lu.%lu usec\n"
-		  "last_received_ts = %lu.%lu usec\n"
+		  "last_ts = %ld.%ld usec\n"
+		  "last_received_ts = %ld.%ld usec\n"
 		  "last_seq = %u\n"
-		  "current_ts = %lu.%lu usec\n"
-		  "current_received_ts = %lu.%lu usec\n"
+		  "current_ts = %ld.%ld usec\n"
+		  "current_received_ts = %ld.%ld usec\n"
 		  "current_seq = %u\n"
 		  "count = %u\n"
 		  "seq_step = %d\n",
@@ -644,8 +644,8 @@ static void check_state(struct test_output *o, struct event_state *es)
 	timersub(&es->current_ts, &es->current_received_ts, &diff);
 	if (!analog_tv_connector(o)) {
 		igt_assert_f(diff.tv_sec < 0 || (diff.tv_sec == 0 && diff.tv_usec <= 2000),
-			     "%s ts delayed for too long: %is, %iusec\n",
-			     es->name, (int)diff.tv_sec, (int)diff.tv_usec);
+			     "%s ts delayed for too long: %lds, %ldusec\n",
+			     es->name, diff.tv_sec, diff.tv_usec);
 
 	}
 
@@ -655,9 +655,9 @@ static void check_state(struct test_output *o, struct event_state *es)
 	timersub(&es->current_ts, &es->last_received_ts, &diff);
 	igt_assert_f(timercmp(&es->last_received_ts, &es->current_ts, <),
 		     "%s ts before the %s was issued!\n"
-		     "timerdiff %is, %ius\n",
+		     "timerdiff %lds, %ldusec\n",
 		     es->name, es->name,
-		     (int) diff.tv_sec, (int) diff.tv_usec);
+		     diff.tv_sec, diff.tv_usec);
 
 	/* check only valid if no modeset happens in between, that increments by
 	 * (1 << 23) on each step. This bounding matches the one in
@@ -688,8 +688,8 @@ static void check_state(struct test_output *o, struct event_state *es)
 
 		igt_assert_f(fabs((((double) diff.tv_usec) - usec_interflip) /
 				  usec_interflip) <= 0.005,
-			     "inter-%s ts jitter: %is, %ius\n",
-			     es->name, (int) diff.tv_sec, (int) diff.tv_usec);
+			     "inter-%s ts jitter: %lds, %ldusec\n",
+			     es->name, diff.tv_sec, diff.tv_usec);
 
 		igt_assert_f(es->current_seq == es->last_seq + o->seq_step,
 			     "unexpected %s seq %u, expected %u\n",
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index 23c2b0658474..e7acc7cabbed 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1361,7 +1361,7 @@ static void setup_sink_crc(void)
 	else if (rc == SINK_CRC_SIZE)
 		sink_crc.supported = true;
 	else
-		igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n",
+		igt_info("Unexpected sink CRC error, rc=:%zd errno:%d %s\n",
 			 rc, errno_, strerror(errno_));
 }
 
diff --git a/tools/hsw_compute_wrpll.c b/tools/hsw_compute_wrpll.c
index e27cc349e630..6c85c07c77c4 100644
--- a/tools/hsw_compute_wrpll.c
+++ b/tools/hsw_compute_wrpll.c
@@ -642,7 +642,7 @@ int main(void)
 
 		wrpll_compute_rnp(ref->clock, &r2, &n2, &p);
 		igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p,
-			      "Computed value differs for %li Hz:\n""  Reference: (%u,%u,%u)\n""  Computed:  (%u,%u,%u)\n", (int64_t)ref->clock * 1000, ref->r2, ref->n2, ref->p, r2, n2, p);
+			      "Computed value differs for %"PRId64" Hz:\n""  Reference: (%u,%u,%u)\n""  Computed:  (%u,%u,%u)\n", (int64_t)ref->clock * 1000, ref->r2, ref->n2, ref->p, r2, n2, p);
 	}
 
 	return 0;
diff --git a/tools/intel_firmware_decode.c b/tools/intel_firmware_decode.c
index ae6e02c4566c..61ce3a531165 100644
--- a/tools/intel_firmware_decode.c
+++ b/tools/intel_firmware_decode.c
@@ -25,6 +25,7 @@
  */
 
 #include <fcntl.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
@@ -166,7 +167,7 @@ static void csr_open(csr_t *ctx, const char *filename)
 			 ctx->fd, 0);
 	igt_fail_on_f(ctx->base == MAP_FAILED, "Couldn't mmap %s\n", filename);
 
-	printf("Firmware: %s (%zd bytes)\n", filename, st.st_size);
+	printf("Firmware: %s (%"PRId64" bytes)\n", filename, (int64_t)st.st_size);
 
 	ctx->css_header = (struct intel_css_header *)ctx->base;
 	ctx->package_header = (struct intel_package_header *)
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index b5cfda043dd9..4f327c6daf6b 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -679,7 +679,7 @@ int main(int argc, char **argv)
 
 			for (i = 0; i < MAX_NUM_TOP_BITS; i++) {
 				if (i < STATS_COUNT && HAS_STATS_REGS(devid)) {
-					fprintf(output, "%lu\t",
+					fprintf(output, "%"PRIu64"\t",
 						   stats[i] - last_stats[i]);
 					last_stats[i] = stats[i];
 				}
-- 
2.4.10

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

             reply	other threads:[~2015-12-14 20:15 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 20:15 ville.syrjala [this message]
2015-12-14 20:15 ` [PATCH i-g-t 2/7] tests/gem_mmap_gtt: Deal with tile sizes on gen2/3 ville.syrjala
2015-12-14 21:52   ` Chris Wilson
2015-12-15 20:37     ` Ville Syrjälä
2015-12-15 20:51   ` Paulo Zanoni
2015-12-15 21:08     ` Ville Syrjälä
2015-12-15 21:19       ` Paulo Zanoni
2015-12-15 21:30         ` Ville Syrjälä
2015-12-14 20:15 ` [PATCH i-g-t 3/7] tests/gem_mmap_gtt: Add progress indicators ville.syrjala
2015-12-14 20:15 ` [PATCH i-g-t 4/7] tests/gem_mmap_gtt: Make the small-bo tiling tests work on old platforms ville.syrjala
2015-12-14 20:49   ` Chris Wilson
2015-12-14 20:54     ` Chris Wilson
2015-12-15  9:41       ` Ville Syrjälä
2015-12-15  9:57         ` Chris Wilson
2015-12-15 10:57           ` Ville Syrjälä
2015-12-15 11:16             ` Chris Wilson
2015-12-15 11:29               ` Ville Syrjälä
2015-12-15 12:01                 ` Ville Syrjälä
2015-12-15 12:30                   ` Chris Wilson
2015-12-16 10:46                     ` Daniel Vetter
2015-12-16 11:11                       ` Chris Wilson
2015-12-14 20:15 ` [PATCH i-g-t 5/7] lib/debugfs: Read the crc frame counter as hex ville.syrjala
2015-12-15 12:03   ` Morton, Derek J
2015-12-15 12:46     ` Ville Syrjälä
2015-12-14 20:15 ` [PATCH i-g-t 6/7] tests/kms_flip: Increase TEST_TS_CONT max seq difference to 150 ville.syrjala
2015-12-16 10:49   ` Daniel Vetter
2015-12-14 20:15 ` [PATCH i-g-t 7/7] tests/kms_pipe_crc_basic: Use igt_assert_eq() to see the failing frame counts ville.syrjala

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=1450124156-12679-1-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.