From 7d33d2b5b8581ed9f7b2ad93156cde223df718dc Mon Sep 17 00:00:00 2001 From: Lei Yang Date: Sun, 5 Nov 2017 18:56:40 +0800 Subject: selftests: memfd_test.c: fix compilation warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace '%d' by '%zu' to fix the following compilation warning. memfd_test.c:517:3: warning: format ‘%d’ expects argument of type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=] printf("malloc(%d) failed: %m\n", mfd_def_size * 8); ^ memfd_test.c: In function ‘mfd_fail_grow_write’: memfd_test.c:537:3: warning: format ‘%d’ expects argument of type ‘int’,but argument 2 has type ‘size_t’ [-Wformat=] printf("malloc(%d) failed: %m\n", mfd_def_size * 8); Signed-off-by: Lei Yang Signed-off-by: Shuah Khan --- tools/testing/selftests/memfd/memfd_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 845e5f6..132a54f 100644 --- a/tools/testing/selftests/memfd/memfd_test.c +++ b/tools/testing/selftests/memfd/memfd_test.c @@ -515,7 +515,7 @@ static void mfd_assert_grow_write(int fd) buf = malloc(mfd_def_size * 8); if (!buf) { - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); abort(); } @@ -535,7 +535,7 @@ static void mfd_fail_grow_write(int fd) buf = malloc(mfd_def_size * 8); if (!buf) { - printf("malloc(%d) failed: %m\n", mfd_def_size * 8); + printf("malloc(%zu) failed: %m\n", mfd_def_size * 8); abort(); } -- cgit v1.1