[igt-dev] [PATCH i-g-t] Fix 32bit gcc warnings

Ville Syrjala ville.syrjala at linux.intel.com
Mon Sep 10 15:00:18 UTC 2018


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

../tests/eviction_common.c:158:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=]
etc.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/drv_suspend.c     | 4 ++--
 tests/eviction_common.c | 6 +++---
 tools/aubdump.c         | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/drv_suspend.c b/tests/drv_suspend.c
index b4212dca13b3..84cb3b490c40 100644
--- a/tests/drv_suspend.c
+++ b/tests/drv_suspend.c
@@ -177,10 +177,10 @@ test_shrink(int fd, unsigned int mode)
 
 	intel_purge_vm_caches(fd);
 
-	igt_debug("Locking %'"PRIu64" B (%'"PRIu64" MiB)\n",
+	igt_debug("Locking %'zu B (%'zu MiB)\n",
 		  size, size >> 20);
 	igt_assert(!mlock(mem, size));
-	igt_info("Locked %'"PRIu64" B (%'"PRIu64" MiB)\n",
+	igt_info("Locked %'zu B (%'zu MiB)\n",
 		 size, size >> 20);
 
 	intel_purge_vm_caches(fd);
diff --git a/tests/eviction_common.c b/tests/eviction_common.c
index 8535dfcaff90..321772ba7389 100644
--- a/tests/eviction_common.c
+++ b/tests/eviction_common.c
@@ -155,10 +155,10 @@ static void mlocked_evictions(int fd, struct igt_eviction_test_ops *ops,
 		igt_assert(bo);
 		lock -= ALIGN(surface_count * sizeof(*bo), 4096);
 
-		igt_debug("Locking %'"PRIu64" B (%'"PRIu64" MiB)\n",
+		igt_debug("Locking %'zu B (%'zu MiB)\n",
 			  lock, lock >> 20);
 		igt_assert(!mlock(mem, lock));
-		igt_info("Locked %'"PRIu64" B (%'"PRIu64" MiB)\n",
+		igt_info("Locked %'zu B (%'zu MiB)\n",
 			 lock, lock >> 20);
 
 		for (n = 0; n < surface_count; n++)
@@ -176,7 +176,7 @@ static void mlocked_evictions(int fd, struct igt_eviction_test_ops *ops,
 			 */
 			lock += surface_size;
 			igt_assert(!mlock(mem, lock));
-			igt_debug("Total locked %'"PRIu64" B (%'"PRIu64" MiB)\n",
+			igt_debug("Total locked %'zu B (%'zu MiB)\n",
 				  lock,
 				  lock >> 20);
 		}
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 2d2b6c607a43..00e197121b95 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -496,7 +496,7 @@ gen8_map_ggtt_range(uint64_t start, uint64_t end)
 			break;
 
 		if (verbose)
-			printf("MAPPING 0x%08lx-0x%08lx\n",
+			printf("MAPPING 0x%08"PRIx64"-0x%08"PRIx64"\n",
 			       (uint64_t)pos1 << 12, (uint64_t)pos2 << 12);
 		gen8_emit_ggtt_pte_for_range((uint64_t)pos1 << 12,
 		                             (uint64_t)pos2 << 12);
@@ -960,14 +960,14 @@ dump_execbuffer2(int fd, struct drm_i915_gem_execbuffer2 *execbuffer2)
 		if (obj->flags & EXEC_OBJECT_PINNED) {
 			bo->offset = obj->offset;
 			if (verbose)
-				printf("BO #%d (%dB) pinned @ 0x%lx\n",
+				printf("BO #%d (%dB) pinned @ 0x%"PRIx64"\n",
 				       obj->handle, bo->size, bo->offset);
 		} else {
 			if (obj->alignment != 0)
 				offset = align_u32(offset, obj->alignment);
 			bo->offset = offset;
 			if (verbose)
-				printf("BO #%d (%dB) @ 0x%lx\n", obj->handle,
+				printf("BO #%d (%dB) @ 0x%"PRIx64"\n", obj->handle,
 				       bo->size, bo->offset);
 			offset = align_u32(offset + bo->size + 4095, 4096);
 		}
-- 
2.16.4



More information about the igt-dev mailing list