[PATCH v2 07/13] mm/memory-failure: simplify unneeded hwpoison_filter() variant

From: Miaohe Lin
Date: Thu Jun 06 2024 - 02:39:15 EST


When CONFIG_HWPOISON_INJECT is not enabled, there is no user of the
hwpoison_filter() outside memory-failure. So there is no need to export
it and we can further make it 'static' and 'inline'.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202405242336.o1NEOrln-lkp@xxxxxxxxx/
Signed-off-by: Miaohe Lin <linmiaohe@xxxxxxxxxx>
---
mm/memory-failure.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 339752d768d8..6e26b8b975e5 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -294,15 +294,14 @@ int hwpoison_filter(struct page *p)

return 0;
}
+EXPORT_SYMBOL_GPL(hwpoison_filter);
#else
-int hwpoison_filter(struct page *p)
+static inline int hwpoison_filter(struct page *p)
{
return 0;
}
#endif

-EXPORT_SYMBOL_GPL(hwpoison_filter);
-
/*
* Kill all processes that have a poisoned page mapped and then isolate
* the page.
--
2.33.0