Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: Make VM_FAULT_RESULT_TRACE compatible with sparse
@ 2026-08-07 17:13 Bart Van Assche
  2026-08-07 17:21 ` Lorenzo Stoakes (ARM)
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2026-08-07 17:13 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, Bart Van Assche, Lorenzo Stoakes (Oracle),
	David Hildenbrand

Fix the following sparse warnings that appear while building f2fs:

./include/trace/events/f2fs.h:1469:1: warning: incorrect type in initializer (different base types)
./include/trace/events/f2fs.h:1469:1:    expected unsigned long mask
./include/trace/events/f2fs.h:1469:1:    got restricted vm_fault_t

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 include/linux/mm_types.h | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index b18c2b2e7d2c..fcd7d6cfce0f 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -1703,20 +1703,20 @@ enum vm_fault_reason {
 			VM_FAULT_SIGSEGV | VM_FAULT_HWPOISON |	\
 			VM_FAULT_HWPOISON_LARGE | VM_FAULT_FALLBACK)
 
-#define VM_FAULT_RESULT_TRACE \
-	{ VM_FAULT_OOM,                 "OOM" },	\
-	{ VM_FAULT_SIGBUS,              "SIGBUS" },	\
-	{ VM_FAULT_MAJOR,               "MAJOR" },	\
-	{ VM_FAULT_HWPOISON,            "HWPOISON" },	\
-	{ VM_FAULT_HWPOISON_LARGE,      "HWPOISON_LARGE" },	\
-	{ VM_FAULT_SIGSEGV,             "SIGSEGV" },	\
-	{ VM_FAULT_NOPAGE,              "NOPAGE" },	\
-	{ VM_FAULT_LOCKED,              "LOCKED" },	\
-	{ VM_FAULT_RETRY,               "RETRY" },	\
-	{ VM_FAULT_FALLBACK,            "FALLBACK" },	\
-	{ VM_FAULT_DONE_COW,            "DONE_COW" },	\
-	{ VM_FAULT_NEEDDSYNC,           "NEEDDSYNC" },	\
-	{ VM_FAULT_COMPLETED,           "COMPLETED" }
+#define VM_FAULT_RESULT_TRACE						\
+	{ (__force u32)VM_FAULT_OOM,                 "OOM" },		\
+	{ (__force u32)VM_FAULT_SIGBUS,              "SIGBUS" },	\
+	{ (__force u32)VM_FAULT_MAJOR,               "MAJOR" },		\
+	{ (__force u32)VM_FAULT_HWPOISON,            "HWPOISON" },	\
+	{ (__force u32)VM_FAULT_HWPOISON_LARGE,      "HWPOISON_LARGE" }, \
+	{ (__force u32)VM_FAULT_SIGSEGV,             "SIGSEGV" },	\
+	{ (__force u32)VM_FAULT_NOPAGE,              "NOPAGE" },	\
+	{ (__force u32)VM_FAULT_LOCKED,              "LOCKED" },	\
+	{ (__force u32)VM_FAULT_RETRY,               "RETRY" },		\
+	{ (__force u32)VM_FAULT_FALLBACK,            "FALLBACK" },	\
+	{ (__force u32)VM_FAULT_DONE_COW,            "DONE_COW" },	\
+	{ (__force u32)VM_FAULT_NEEDDSYNC,           "NEEDDSYNC" },	\
+	{ (__force u32)VM_FAULT_COMPLETED,           "COMPLETED" }
 
 struct vm_special_mapping {
 	const char *name;	/* The name, e.g. "[vdso]". */


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

* Re: [PATCH] mm: Make VM_FAULT_RESULT_TRACE compatible with sparse
  2026-08-07 17:13 [PATCH] mm: Make VM_FAULT_RESULT_TRACE compatible with sparse Bart Van Assche
@ 2026-08-07 17:21 ` Lorenzo Stoakes (ARM)
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Stoakes (ARM) @ 2026-08-07 17:21 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Andrew Morton, linux-mm, David Hildenbrand

On Fri, Aug 07, 2026 at 10:13:10AM -0700, Bart Van Assche wrote:
> Fix the following sparse warnings that appear while building f2fs:
>
> ./include/trace/events/f2fs.h:1469:1: warning: incorrect type in initializer (different base types)
> ./include/trace/events/f2fs.h:1469:1:    expected unsigned long mask
> ./include/trace/events/f2fs.h:1469:1:    got restricted vm_fault_t
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Lorenzo Stoakes (Oracle) <ljs@kernel.org>

I no longer work at Oracle ;)

> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

This seems reasonable to me, AFAICT.

Acked-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>

> ---
>  include/linux/mm_types.h | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index b18c2b2e7d2c..fcd7d6cfce0f 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -1703,20 +1703,20 @@ enum vm_fault_reason {
>  			VM_FAULT_SIGSEGV | VM_FAULT_HWPOISON |	\
>  			VM_FAULT_HWPOISON_LARGE | VM_FAULT_FALLBACK)
>
> -#define VM_FAULT_RESULT_TRACE \
> -	{ VM_FAULT_OOM,                 "OOM" },	\
> -	{ VM_FAULT_SIGBUS,              "SIGBUS" },	\
> -	{ VM_FAULT_MAJOR,               "MAJOR" },	\
> -	{ VM_FAULT_HWPOISON,            "HWPOISON" },	\
> -	{ VM_FAULT_HWPOISON_LARGE,      "HWPOISON_LARGE" },	\
> -	{ VM_FAULT_SIGSEGV,             "SIGSEGV" },	\
> -	{ VM_FAULT_NOPAGE,              "NOPAGE" },	\
> -	{ VM_FAULT_LOCKED,              "LOCKED" },	\
> -	{ VM_FAULT_RETRY,               "RETRY" },	\
> -	{ VM_FAULT_FALLBACK,            "FALLBACK" },	\
> -	{ VM_FAULT_DONE_COW,            "DONE_COW" },	\
> -	{ VM_FAULT_NEEDDSYNC,           "NEEDDSYNC" },	\
> -	{ VM_FAULT_COMPLETED,           "COMPLETED" }
> +#define VM_FAULT_RESULT_TRACE						\
> +	{ (__force u32)VM_FAULT_OOM,                 "OOM" },		\
> +	{ (__force u32)VM_FAULT_SIGBUS,              "SIGBUS" },	\
> +	{ (__force u32)VM_FAULT_MAJOR,               "MAJOR" },		\
> +	{ (__force u32)VM_FAULT_HWPOISON,            "HWPOISON" },	\
> +	{ (__force u32)VM_FAULT_HWPOISON_LARGE,      "HWPOISON_LARGE" }, \
> +	{ (__force u32)VM_FAULT_SIGSEGV,             "SIGSEGV" },	\
> +	{ (__force u32)VM_FAULT_NOPAGE,              "NOPAGE" },	\
> +	{ (__force u32)VM_FAULT_LOCKED,              "LOCKED" },	\
> +	{ (__force u32)VM_FAULT_RETRY,               "RETRY" },		\
> +	{ (__force u32)VM_FAULT_FALLBACK,            "FALLBACK" },	\
> +	{ (__force u32)VM_FAULT_DONE_COW,            "DONE_COW" },	\
> +	{ (__force u32)VM_FAULT_NEEDDSYNC,           "NEEDDSYNC" },	\
> +	{ (__force u32)VM_FAULT_COMPLETED,           "COMPLETED" }
>
>  struct vm_special_mapping {
>  	const char *name;	/* The name, e.g. "[vdso]". */

--
Cheers, Lorenzo


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

end of thread, other threads:[~2026-08-07 17:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 17:13 [PATCH] mm: Make VM_FAULT_RESULT_TRACE compatible with sparse Bart Van Assche
2026-08-07 17:21 ` Lorenzo Stoakes (ARM)

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