Skip to contentSkip to conversation

mm/shmem: Fix a build error due to shmem_unuse() under !CONFIG_SHMEM

PATCH In review SeongJae Park 3 participants 3 messages Dec 30, 2021 – Jan 3, 2022

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

PATCH 1/1 mm/shmem: Fix a build error due to shmem_unuse() under !CONFIG_SHMEM

A patch[1] in -mm tree that titled mm-simplify-try_to_unuse.patch[2] didn't properly change the type of 'shmem_unuse()' definition under !CONFIG_SHMEM, and therefore causing below build error when CONFIG_SHMEM is not set.

linux/mm/shmem.c:3992:5: error: conflicting types for 'shmem_unuse'
3992 | int shmem_unuse(unsigned int type, unsigned long *fs_pages_to_unuse)
| ^~~~~~~~~~~
In file included from linux/include/linux/khugepaged.h:6,
from linux/mm/shmem.c:37:
linux/include/linux/shmem_fs.h:86:5: note: previous declaration of 'shmem_unuse' was here
86 | int shmem_unuse(unsigned int type);
| ^~~~~~~~~~~
linux/scripts/Makefile.build:289: recipe for target 'mm/shmem.o' failed

This commit fixes the issue by fixing the type of the definition under the config.

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-simplify-try_to_unuse.patch

---
 mm/shmem.c              | 2 +-
 scripts/rust-version.sh | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 scripts/rust-version.sh
mm/shmem.c +1 -1
index 421b2459929a..a83c91282c1f 100644
@@ -3989,7 +3989,7 @@ int __init shmem_init(void)
 	return 0;
 }
 
-int shmem_unuse(unsigned int type, unsigned long *fs_pages_to_unuse)
+int shmem_unuse(unsigned int type)
 {
 	return 0;
 }
scripts/rust-version.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · SeongJae Park

A patch[1] in -mm tree that titled mm-simplify-try_to_unuse.patch[2] didn't properly change the type of 'shmem_unuse()' definition under !CONFIG_SHMEM, and therefore causing below build error when CONFIG_SHMEM is not set.

linux/mm/shmem.c:3992:5: error: conflicting types for 'shmem_unuse'
3992 | int shmem_unuse(unsigned int type, unsigned long *fs_pages_to_unuse)
| ^~~~~~~~~~~
In file included from linux/include/linux/khugepaged.h:6,
from linux/mm/shmem.c:37:
linux/include/linux/shmem_fs.h:86:5: note: previous declaration of 'shmem_unuse' was here
86 | int shmem_unuse(unsigned int type);
| ^~~~~~~~~~~
linux/scripts/Makefile.build:289: recipe for target 'mm/shmem.o' failed

Quoted 7 lines

This commit fixes the issue by fixing the type of the definition under the config.

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://www.ozlabs.org/~akpm/mmotm/broken-out/mm-simplify-try_to_unuse.patch

Thanks.

Quoted 22 lines
---
 mm/shmem.c              | 2 +-
 scripts/rust-version.sh | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 scripts/rust-version.sh
mm/shmem.c +1 -1
index 421b2459929a..a83c91282c1f 100644
@@ -3989,7 +3989,7 @@ int __init shmem_init(void)
 	return 0;
 }
 
-int shmem_unuse(unsigned int type, unsigned long *fs_pages_to_unuse)
+int shmem_unuse(unsigned int type)
 {
 	return 0;
 }
scripts/rust-version.sh +0 -0
old mode 100644
new mode 100755
Signature · 1 line
~Randy