diff mbox series

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

Message ID 20240606063247.712575-8-linmiaohe@huawei.com (mailing list archive)
State New
Headers show
Series Some cleanups for memory-failure | expand

Commit Message

Miaohe Lin June 6, 2024, 6:32 a.m. UTC
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@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405242336.o1NEOrln-lkp@intel.com/
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memory-failure.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

kernel test robot June 6, 2024, 5:15 p.m. UTC | #1
Hi Miaohe,

kernel test robot noticed the following build errors:

[auto build test ERROR on 19b8422c5bd56fb5e7085995801c6543a98bda1f]

url:    https://github.com/intel-lab-lkp/linux/commits/Miaohe-Lin/mm-memory-failure-simplify-put_ref_page/20240606-143939
base:   19b8422c5bd56fb5e7085995801c6543a98bda1f
patch link:    https://lore.kernel.org/r/20240606063247.712575-8-linmiaohe%40huawei.com
patch subject: [PATCH v2 07/13] mm/memory-failure: simplify unneeded hwpoison_filter() variant
config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240607/202406070136.hGQwVbsv-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240607/202406070136.hGQwVbsv-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406070136.hGQwVbsv-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/memory-failure.c:299:19: error: static declaration of 'hwpoison_filter' follows non-static declaration
     299 | static inline int hwpoison_filter(struct page *p)
         |                   ^~~~~~~~~~~~~~~
   In file included from mm/memory-failure.c:64:
   mm/internal.h:1072:12: note: previous declaration of 'hwpoison_filter' with type 'int(struct page *)'
    1072 | extern int hwpoison_filter(struct page *p);
         |            ^~~~~~~~~~~~~~~


vim +/hwpoison_filter +299 mm/memory-failure.c

   280	
   281	int hwpoison_filter(struct page *p)
   282	{
   283		if (!hwpoison_filter_enable)
   284			return 0;
   285	
   286		if (hwpoison_filter_dev(p))
   287			return -EINVAL;
   288	
   289		if (hwpoison_filter_flags(p))
   290			return -EINVAL;
   291	
   292		if (hwpoison_filter_task(p))
   293			return -EINVAL;
   294	
   295		return 0;
   296	}
   297	EXPORT_SYMBOL_GPL(hwpoison_filter);
   298	#else
 > 299	static inline int hwpoison_filter(struct page *p)
   300	{
   301		return 0;
   302	}
   303	#endif
   304
Miaohe Lin June 7, 2024, 3:30 a.m. UTC | #2
On 2024/6/7 1:15, kernel test robot wrote:
> Hi Miaohe,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on 19b8422c5bd56fb5e7085995801c6543a98bda1f]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Miaohe-Lin/mm-memory-failure-simplify-put_ref_page/20240606-143939
> base:   19b8422c5bd56fb5e7085995801c6543a98bda1f
> patch link:    https://lore.kernel.org/r/20240606063247.712575-8-linmiaohe%40huawei.com
> patch subject: [PATCH v2 07/13] mm/memory-failure: simplify unneeded hwpoison_filter() variant
> config: arm64-defconfig (https://download.01.org/0day-ci/archive/20240607/202406070136.hGQwVbsv-lkp@intel.com/config)
> compiler: aarch64-linux-gcc (GCC) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240607/202406070136.hGQwVbsv-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202406070136.hGQwVbsv-lkp@intel.com/
> 
> All errors (new ones prefixed by >>):
> 
>>> mm/memory-failure.c:299:19: error: static declaration of 'hwpoison_filter' follows non-static declaration
>      299 | static inline int hwpoison_filter(struct page *p)
>          |                   ^~~~~~~~~~~~~~~
>    In file included from mm/memory-failure.c:64:
>    mm/internal.h:1072:12: note: previous declaration of 'hwpoison_filter' with type 'int(struct page *)'
>     1072 | extern int hwpoison_filter(struct page *p);
>          |            ^~~~~~~~~~~~~~~
> 

Thanks for reporting again. Will fix it.
Thanks.
.
diff mbox series

Patch

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.