selftests/mm: Fix build warnings on ppc64
Subsystems (4)
PATCH 1/1 selftests/mm: Fix build warnings on ppc64
Fix warnings like:
In file included from uffd-unit-tests.c:8:
uffd-unit-tests.c: In function ‘uffd_poison_handle_fault’:
uffd-common.h:45:33: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]
By switching to unsigned long long for u64 for ppc64 builds.
Signed-off-by Michael Ellerman <[email protected]>
--- tools/testing/selftests/mm/gup_test.c | 1 + tools/testing/selftests/mm/uffd-common.h | 1 + 2 files changed, 2 insertions(+)
tools/testing/selftests/mm/gup_test.c +1 -0
@@ -1,3 +1,4 @@ +#define __SANE_USERSPACE_TYPES__// Use ll64 #include <fcntl.h> #include <errno.h> #include <stdio.h>
tools/testing/selftests/mm/uffd-common.h +1 -0
@@ -8,6 +8,7 @@#define __UFFD_COMMON_H__#define _GNU_SOURCE +#define __SANE_USERSPACE_TYPES__// Use ll64 #include <stdio.h> #include <errno.h> #include <unistd.h>
Signature · 1 line
2.45.1
Quoted 11 lines · Michael Ellerman
Fix warnings like:
In file included from uffd-unit-tests.c:8:
uffd-unit-tests.c: In function ‘uffd_poison_handle_fault’:
uffd-common.h:45:33: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]By switching to unsigned long long for u64 for ppc64 builds.
Signed-off-by Michael Ellerman <[email protected]>
Reviewed-by Muhammad Usama Anjum <[email protected]>
Quoted 26 lines
--- tools/testing/selftests/mm/gup_test.c | 1 + tools/testing/selftests/mm/uffd-common.h | 1 + 2 files changed, 2 insertions(+)tools/testing/selftests/mm/gup_test.c +1
-0@@ -1,3 +1,4 @@ +#define __SANE_USERSPACE_TYPES__// Use ll64 #include <fcntl.h> #include <errno.h> #include <stdio.h> tools/testing/selftests/mm/uffd-common.h +1
-0@@ -8,6 +8,7 @@#define __UFFD_COMMON_H__#define _GNU_SOURCE +#define __SANE_USERSPACE_TYPES__// Use ll64 #include <stdio.h> #include <errno.h> #include <unistd.h>
Signature · 2 lines
BR, Muhammad Usama Anjum