linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/mm: Fix build warnings on ppc64
@ 2024-05-21  3:02 Michael Ellerman
  2024-05-25  4:32 ` Muhammad Usama Anjum
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2024-05-21  3:02 UTC (permalink / raw)
  To: linux-kselftest, skhan; +Cc: linux-kernel, linuxppc-dev, akpm, linux-mm

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 <mpe@ellerman.id.au>
---
 tools/testing/selftests/mm/gup_test.c    | 1 +
 tools/testing/selftests/mm/uffd-common.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/testing/selftests/mm/gup_test.c b/tools/testing/selftests/mm/gup_test.c
index bd335cf9bc0e..bdeaac67ff9a 100644
--- a/tools/testing/selftests/mm/gup_test.c
+++ b/tools/testing/selftests/mm/gup_test.c
@@ -1,3 +1,4 @@
+#define __SANE_USERSPACE_TYPES__ // Use ll64
 #include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selftests/mm/uffd-common.h
index cc5629c3d2aa..a70ae10b5f62 100644
--- a/tools/testing/selftests/mm/uffd-common.h
+++ b/tools/testing/selftests/mm/uffd-common.h
@@ -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>
-- 
2.45.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/mm: Fix build warnings on ppc64
  2024-05-21  3:02 [PATCH] selftests/mm: Fix build warnings on ppc64 Michael Ellerman
@ 2024-05-25  4:32 ` Muhammad Usama Anjum
  0 siblings, 0 replies; 2+ messages in thread
From: Muhammad Usama Anjum @ 2024-05-25  4:32 UTC (permalink / raw)
  To: Michael Ellerman, linux-kselftest, skhan
  Cc: Muhammad Usama Anjum, linux-kernel, linuxppc-dev, akpm, linux-mm

On 5/20/24 8:02 PM, Michael Ellerman wrote:
> 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 <mpe@ellerman.id.au>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>

> ---
>  tools/testing/selftests/mm/gup_test.c    | 1 +
>  tools/testing/selftests/mm/uffd-common.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/tools/testing/selftests/mm/gup_test.c b/tools/testing/selftests/mm/gup_test.c
> index bd335cf9bc0e..bdeaac67ff9a 100644
> --- a/tools/testing/selftests/mm/gup_test.c
> +++ b/tools/testing/selftests/mm/gup_test.c
> @@ -1,3 +1,4 @@
> +#define __SANE_USERSPACE_TYPES__ // Use ll64
>  #include <fcntl.h>
>  #include <errno.h>
>  #include <stdio.h>
> diff --git a/tools/testing/selftests/mm/uffd-common.h b/tools/testing/selftests/mm/uffd-common.h
> index cc5629c3d2aa..a70ae10b5f62 100644
> --- a/tools/testing/selftests/mm/uffd-common.h
> +++ b/tools/testing/selftests/mm/uffd-common.h
> @@ -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>

-- 
BR,
Muhammad Usama Anjum


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-05-25  4:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-21  3:02 [PATCH] selftests/mm: Fix build warnings on ppc64 Michael Ellerman
2024-05-25  4:32 ` Muhammad Usama Anjum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox