Skip to contentSkip to conversation

mm/nommu: Fix return type of filemap_map_pages()

PATCH Applied Geert Uytterhoeven 2 participants 2 messages Jan 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/nommu: Fix return type of filemap_map_pages()

If CONFIG_MMU is not set (e.g. m68k/m5272c3_defconfig):

mm/nommu.c:1671:6: error: conflicting types for ‘filemap_map_pages’
1671 | void filemap_map_pages(struct vm_fault *vmf,
| ^~~~~~~~~~~~~~~~~
In file included from mm/nommu.c:20:
./include/linux/mm.h:2578:19: note: previous declaration of ‘filemap_map_pages’ was here
2578 | extern vm_fault_t filemap_map_pages(struct vm_fault *vmf,
| ^~~~~~~~~~~~~~~~~

The signature of filemap_map_pages() was changed, but the nommu implementation wasn't updated.

Reported-by [email protected]
Fixes f9ce0be71d1fbb03 ("mm: Cleanup faultaround and finish_fault() codepaths")

---
Compile-tested only.
Feel free to fold into the commit introducing the issue.

---
 mm/nommu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
mm/nommu.c +2 -1
index 870fea12823e633d..5c9ab799c0e63958 100644
@@ -1668,10 +1668,11 @@ vm_fault_t filemap_fault(struct vm_fault *vmf)
 }
 EXPORT_SYMBOL(filemap_fault);
 
-void filemap_map_pages(struct vm_fault *vmf,
+vm_fault_t filemap_map_pages(struct vm_fault *vmf,
 		pgoff_t start_pgoff, pgoff_t end_pgoff)
 {
 	BUG();
+	return 0;
 }
 EXPORT_SYMBOL(filemap_map_pages);
 
Signature · 1 line
2.25.1
Applied
#1 lore raw
Quoted 11 lines · Geert Uytterhoeven

If CONFIG_MMU is not set (e.g. m68k/m5272c3_defconfig):

mm/nommu.c:1671:6: error: conflicting types for ‘filemap_map_pages’
1671 | void filemap_map_pages(struct vm_fault *vmf,
| ^~~~~~~~~~~~~~~~~
In file included from mm/nommu.c:20:
./include/linux/mm.h:2578:19: note: previous declaration of ‘filemap_map_pages’ was here
2578 | extern vm_fault_t filemap_map_pages(struct vm_fault *vmf,
| ^~~~~~~~~~~~~~~~~

[...]

Applied to arm64 (for-next/faultaround), thanks!

[1/1] mm/nommu: Fix return type of filemap_map_pages()

      https://git.kernel.org/arm64/c/3f98a28cc372

Cheers,

Signature · 5 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev