summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2024-11-06 14:04:51 +0100
committerMichael Ellerman <mpe@ellerman.id.au>2024-11-07 12:36:30 +0100
commitd5f578f90a34d85f1cabd4c27af1b2d9fbffe64b (patch)
tree4201b8bbeaeaaf44917cd4d4192fafcae5a7ac20 /tools/testing/selftests
parentselftests/powerpc: Give all tests 2 minutes timeout (diff)
downloadlinux-d5f578f90a34d85f1cabd4c27af1b2d9fbffe64b.tar.xz
linux-d5f578f90a34d85f1cabd4c27af1b2d9fbffe64b.zip
selftests/powerpc: Fix 32-bit BE build errors on Ubuntu 24.04
Starting with Ubuntu 24.04, building the selftests with the big endian compiler (which defaults to 32-bit) fails with errors: stack_expansion_ldst.c:178:37: error: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'rlim_t' {aka 'long long unsigned int'} subpage_prot.c:214:38: error: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'off_t' {aka 'long long int'} Prior to 24.04 rlim_t was long unsigned int, and off_t was long int. Cast to unsigned long long and long long before passing to printf to avoid the errors. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://patch.msgid.link/20241106130453.1741013-3-mpe@ellerman.id.au
Diffstat (limited to 'tools/testing/selftests')
-rw-r--r--tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c2
-rw-r--r--tools/testing/selftests/powerpc/mm/subpage_prot.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c b/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c
index ed9143990888..9c0d343d7137 100644
--- a/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c
+++ b/tools/testing/selftests/powerpc/mm/stack_expansion_ldst.c
@@ -175,7 +175,7 @@ static int test(void)
page_size = getpagesize();
getrlimit(RLIMIT_STACK, &rlimit);
- printf("Stack rlimit is 0x%lx\n", rlimit.rlim_cur);
+ printf("Stack rlimit is 0x%llx\n", (unsigned long long)rlimit.rlim_cur);
printf("Testing loads ...\n");
test_one_type(LOAD, page_size, rlimit.rlim_cur);
diff --git a/tools/testing/selftests/powerpc/mm/subpage_prot.c b/tools/testing/selftests/powerpc/mm/subpage_prot.c
index 3ae77ba93208..8cf9fd5fed1c 100644
--- a/tools/testing/selftests/powerpc/mm/subpage_prot.c
+++ b/tools/testing/selftests/powerpc/mm/subpage_prot.c
@@ -211,8 +211,8 @@ int test_file(void)
perror("failed to map file");
return 1;
}
- printf("allocated %s for 0x%lx bytes at %p\n",
- file_name, filesize, fileblock);
+ printf("allocated %s for 0x%llx bytes at %p\n",
+ file_name, (long long)filesize, fileblock);
printf("testing file map...\n");