Skip to content

Commit dca1c4a

Browse files
andy-shevopsiff
authored andcommitted
mm/hmm: move pmd_to_hmm_pfn_flags() to the respective #ifdeffery
commit 188cb385bbf04d486df3e52f28c47b3961f5f0c0 upstream. When pmd_to_hmm_pfn_flags() is unused, it prevents kernel builds with clang, `make W=1` and CONFIG_TRANSPARENT_HUGEPAGE=n: mm/hmm.c:186:29: warning: unused function 'pmd_to_hmm_pfn_flags' [-Wunused-function] Fix this by moving the function to the respective existing ifdeffery for its the only user. See also: 6863f56 ("kbuild: allow Clang to find unused static inline functions for W=1 build") Link: https://lkml.kernel.org/r/[email protected] Fixes: 992de9a ("mm/hmm: allow to mirror vma of a file on a DAX backed filesystem") Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Leon Romanovsky <[email protected]> Reviewed-by: Alistair Popple <[email protected]> Cc: Andriy Shevchenko <[email protected]> Cc: Bill Wendling <[email protected]> Cc: Jerome Glisse <[email protected]> Cc: Justin Stitt <[email protected]> Cc: Nathan Chancellor <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit e1ee74b9eeb290f38cb63d356ca744f2e4c6e646)
1 parent 7a1201a commit dca1c4a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/hmm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ static inline unsigned long hmm_pfn_flags_order(unsigned long order)
173173
return order << HMM_PFN_ORDER_SHIFT;
174174
}
175175

176+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
176177
static inline unsigned long pmd_to_hmm_pfn_flags(struct hmm_range *range,
177178
pmd_t pmd)
178179
{
@@ -183,7 +184,6 @@ static inline unsigned long pmd_to_hmm_pfn_flags(struct hmm_range *range,
183184
hmm_pfn_flags_order(PMD_SHIFT - PAGE_SHIFT);
184185
}
185186

186-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
187187
static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr,
188188
unsigned long end, unsigned long hmm_pfns[],
189189
pmd_t pmd)

0 commit comments

Comments
 (0)