On 32-bit architectures size_t is an unsigned int, and printing it with
%ld warns:
dmabuf-heap.c:215:43: warning: format '%ld' expects argument of type 'long
int', but argument 2 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
Use %zu.
Signed-off-by: Sasha Levin <[email protected]>
---
Found with a 32-bit build of the selftests with a 64-bit time_t (gcc 16
and clang 21 with -m32 -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64);
KernelCI's 32-bit arm builds show the same warnings. The changed files
build without format warnings there now, and the x86_64 builds don't
change. The other selftests get the same kind of fix in separate
patches.
tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
index 1d49df6719198..c65efc088e88d 100644
--- a/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
+++ b/tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c
@@ -212,7 +212,7 @@ static void test_alloc_zeroed(char *heap_name, size_t size)
void *p = NULL;
char *c;
- ksft_print_msg("Testing alloced %ldk buffers are zeroed:\n", size /
1024);
+ ksft_print_msg("Testing alloced %zuk buffers are zeroed:\n", size /
1024);
heap_fd = dmabuf_heap_open(heap_name);
/* Allocate and fill a bunch of buffers */
--
2.53.0