Skip to content

Commit 3eb4ee1

Browse files
andy-shevgregkh
authored andcommitted
mm/hmm: move pmd_to_hmm_pfn_flags() to the respective #ifdeffery
commit 188cb38 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]>
1 parent 405a882 commit 3eb4ee1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/hmm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ static inline unsigned long hmm_pfn_flags_order(unsigned long order)
183183
return order << HMM_PFN_ORDER_SHIFT;
184184
}
185185

186+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
186187
static inline unsigned long pmd_to_hmm_pfn_flags(struct hmm_range *range,
187188
pmd_t pmd)
188189
{
@@ -193,7 +194,6 @@ static inline unsigned long pmd_to_hmm_pfn_flags(struct hmm_range *range,
193194
hmm_pfn_flags_order(PMD_SHIFT - PAGE_SHIFT);
194195
}
195196

196-
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
197197
static int hmm_vma_handle_pmd(struct mm_walk *walk, unsigned long addr,
198198
unsigned long end, unsigned long hmm_pfns[],
199199
pmd_t pmd)

0 commit comments

Comments
 (0)