Skip to contentSkip to conversation

mm: memory-failure: correct HWPOISON_INJECT config

PATCH In review Kefeng Wang 4 participants 6 messages Mar 10, 2023 – Mar 13, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: memory-failure: correct HWPOISON_INJECT config

Use IS_ENABLED(CONFIG_HWPOISON_INJECT) to check whether or not to enable HWPoison injector module.

---
 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory-failure.c +1 -1
index fae9baf3be16..f761704d27d7 100644
@@ -168,7 +168,7 @@ static bool page_handle_poison(struct page *page, bool hugepage_or_freepage, boo
 	return true;
 }
 
-#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
+#if IS_ENABLED(CONFIG_HWPOISON_INJECT)
 
 u32 hwpoison_filter_enable = 0;
 u32 hwpoison_filter_dev_major = ~0U;
Signature · 1 line
2.35.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Kefeng Wang

Use IS_ENABLED(CONFIG_HWPOISON_INJECT) to check whether or not to enable HWPoison injector module.

---
  mm/memory-failure.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory-failure.c +0 -0
index fae9baf3be16..f761704d27d7 100644

mm/memory-failure.c static bool page_handle_poison(struct page *page, bool hugepage_or_freepage, boo · line 174

Quoted 8 lines
mm/memory-failure.c +1 -1
@@ -168,7 +168,7 @@ static bool page_handle_poison(struct page *page, bool hugepage_or_freepage, boo
  	return true;
  }
 
-#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
+#if IS_ENABLED(CONFIG_HWPOISON_INJECT)
 
  u32 hwpoison_filter_enable = 0;
  u32 hwpoison_filter_dev_major = ~0U;
Signature · 3 lines
Thanks,

David / dhildenb
maintainer
#2 lore raw
In reply to Kefeng Wang
Quoted 2 lines · On Fri, 10 Mar 2023 21:38:43 +0800 Kefeng Wang <[email protected]>…

Use IS_ENABLED(CONFIG_HWPOISON_INJECT) to check whether or not to enable HWPoison injector module.

This is quite clear from the patch itself. What is unclear is "why". Does it fix a build error? If so, please describe and add a Fixes: if appropriate. Is it just a cleanup? etcetera.

Thanks.

Quoted 13 lines
mm/memory-failure.c +1 -1
@@ -168,7 +168,7 @@ static bool page_handle_poison(struct page *page, bool hugepage_or_freepage, boo
 	return true;
 }
 
-#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
+#if IS_ENABLED(CONFIG_HWPOISON_INJECT)
 
 u32 hwpoison_filter_enable = 0;
 u32 hwpoison_filter_dev_major = ~0U;
Signature · 1 line
2.35.3
#3 lore raw
Quoted 8 lines · Andrew Morton
Quoted 2 lines · On Fri, 10 Mar 2023 21:38:43 +0800 Kefeng Wang <[email protected]>…

Use IS_ENABLED(CONFIG_HWPOISON_INJECT) to check whether or not to enable HWPoison injector module.

This is quite clear from the patch itself. What is unclear is "why". Does it fix a build error? If so, please describe and add a Fixes: if appropriate. Is it just a cleanup? etcetera.

oh, it's just a cleanup, I think it is no need to use the word 'correct', will update the subject and change log.

#5 lore raw

PATCH v2 1/1 mm: memory-failure: directly use IS_ENABLED(CONFIG_HWPOISON_INJECT)

In reply to Kefeng Wang

It's more clear and simple to just use IS_ENABLED(CONFIG_HWPOISON_INJECT) to check whether or not to enable HWPoison injector module instead of CONFIG_HWPOISON_INJECT/CONFIG_HWPOISON_INJECT_MODULE.

---
v2:
- add Ack/Rb, also update the suject/changelog suggested by Andrew

 mm/memory-failure.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory-failure.c +1 -1
index fae9baf3be16..f761704d27d7 100644
@@ -168,7 +168,7 @@ static bool page_handle_poison(struct page *page, bool hugepage_or_freepage, boo
 	return true;
 }
 
-#if defined(CONFIG_HWPOISON_INJECT) || defined(CONFIG_HWPOISON_INJECT_MODULE)
+#if IS_ENABLED(CONFIG_HWPOISON_INJECT)
 
 u32 hwpoison_filter_enable = 0;
 u32 hwpoison_filter_dev_major = ~0U;
Signature · 1 line
2.35.3