mm: Remove unused stub for can_swapin_thp()
Subsystems (2)
PATCH 1/1 mm: Remove unused stub for can_swapin_thp()
When can_swapin_thp() is unused, it prevents kernel builds with clang, make W=1 and CONFIG_WERROR=y:
mm/memory.c:4184:20: error: unused function 'can_swapin_thp' [-Werror,-Wunused-function]
Fix this by removing the unused stub.
See also commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build").
Fixes 242d12c98174 ("mm: support large folios swap-in for sync io devices")
Signed-off-by Andy Shevchenko <[email protected]>
--- mm/memory.c | 5 ----- 1 file changed, 5 deletions(-)
mm/memory.c +0 -5
@@ -4181,11 +4181,6 @@ static struct folio *alloc_swap_folio(struct vm_fault *vmf) return __alloc_swap_folio(vmf); }#else /* !CONFIG_TRANSPARENT_HUGEPAGE */ -static inline bool can_swapin_thp (struct vm_fault *vmf,pte_t *ptep,int nr_pages) -{ -return false; -} -static struct folio *alloc_swap_folio (struct vm_fault *vmf) {return __alloc_swap_folio (vmf);
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Quoted 6 lines · Andy Shevchenko
When
can_swapin_thp()is unused, it prevents kernel builds with clang,make W=1andCONFIG_WERROR=y:
mm/memory.c:4184:20: error: unused function 'can_swapin_thp' [-Werror,-Wunused-function]
Quoted 7 lines
Fix this by removing the unused stub.
See also commit
6863f5643dd7("kbuild: allow Clang to find unused static inline functions for W=1 build").Fixes 242d12c98174 ("mm: support large folios swap-in for sync io devices")Signed-off-by Andy Shevchenko <[email protected]>
Acked-by Barry Song <[email protected]>
Quoted 24 lines
--- mm/memory.c | 5 ----- 1 file changed, 5 deletions(-)mm/memory.c +0
-6@@ -4181,11 +4181,6 @@ static struct folio *alloc_swap_folio(struct vm_fault *vmf) return __alloc_swap_folio(vmf); }#else /* !CONFIG_TRANSPARENT_HUGEPAGE */ -static inline bool can_swapin_thp (struct vm_fault *vmf,pte_t *ptep,int nr_pages) -{ -return false; -} -static struct folio *alloc_swap_folio (struct vm_fault *vmf) {return __alloc_swap_folio (vmf); --2.43.0.rc1.1336.g36b5255a03ac