Skip to content

Commit 9297e53

Browse files
Muhammad Usama Anjumakpm00
authored andcommitted
selftests: mm: fix some build warnings
Fix build warnings: pagemap_ioctl.c:1154:38: warning: format `%s' expects a matching `char *' argument [-Wformat=] pagemap_ioctl.c:1162:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] pagemap_ioctl.c:1192:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] pagemap_ioctl.c:1600:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] pagemap_ioctl.c:1628:51: warning: format `%ld' expects argument of type `long int', but argument 2 has type `int' [-Wformat=] Link: https://lkml.kernel.org/r/20231103182343.2874015-2-usama.anjum@collabora.com Fixes: 46fd75d ("selftests: mm: add pagemap ioctl tests") Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Ryan Roberts <ryan.roberts@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 019b277 commit 9297e53

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

tools/testing/selftests/mm/pagemap_ioctl.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,15 +1151,15 @@ int sanity_tests(void)
11511151
/* 9. Memory mapped file */
11521152
fd = open(__FILE__, O_RDONLY);
11531153
if (fd < 0)
1154-
ksft_exit_fail_msg("%s Memory mapped file\n");
1154+
ksft_exit_fail_msg("%s Memory mapped file\n", __func__);
11551155

11561156
ret = stat(__FILE__, &sbuf);
11571157
if (ret < 0)
11581158
ksft_exit_fail_msg("error %d %d %s\n", ret, errno, strerror(errno));
11591159

11601160
fmem = mmap(NULL, sbuf.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
11611161
if (fmem == MAP_FAILED)
1162-
ksft_exit_fail_msg("error nomem %ld %s\n", errno, strerror(errno));
1162+
ksft_exit_fail_msg("error nomem %d %s\n", errno, strerror(errno));
11631163

11641164
tmp_buf = malloc(sbuf.st_size);
11651165
memcpy(tmp_buf, fmem, sbuf.st_size);
@@ -1189,7 +1189,7 @@ int sanity_tests(void)
11891189

11901190
fmem = mmap(NULL, buf_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
11911191
if (fmem == MAP_FAILED)
1192-
ksft_exit_fail_msg("error nomem %ld %s\n", errno, strerror(errno));
1192+
ksft_exit_fail_msg("error nomem %d %s\n", errno, strerror(errno));
11931193

11941194
wp_init(fmem, buf_size);
11951195
wp_addr_range(fmem, buf_size);
@@ -1596,7 +1596,7 @@ int main(void)
15961596

15971597
fmem = mmap(NULL, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
15981598
if (fmem == MAP_FAILED)
1599-
ksft_exit_fail_msg("error nomem %ld %s\n", errno, strerror(errno));
1599+
ksft_exit_fail_msg("error nomem %d %s\n", errno, strerror(errno));
16001600

16011601
wp_init(fmem, sbuf.st_size);
16021602
wp_addr_range(fmem, sbuf.st_size);
@@ -1624,7 +1624,7 @@ int main(void)
16241624

16251625
fmem = mmap(NULL, buf_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
16261626
if (fmem == MAP_FAILED)
1627-
ksft_exit_fail_msg("error nomem %ld %s\n", errno, strerror(errno));
1627+
ksft_exit_fail_msg("error nomem %d %s\n", errno, strerror(errno));
16281628

16291629
wp_init(fmem, buf_size);
16301630
wp_addr_range(fmem, buf_size);

0 commit comments

Comments
 (0)