x86/mce: remove unused WARN_ON() in mce_register_decode_chain()
Subsystems (3)
PATCH 1/1 x86/mce: remove unused WARN_ON() in mce_register_decode_chain()
enum mce_notifier_prios {
MCE_PRIO_LOWEST,
MCE_PRIO_MCELOG,
MCE_PRIO_EDAC,
After commit c9c6d216ed28 ("x86/mce: Rename "first" function as "early""), there is no other integer between MCE_PRIO_MCELOG and MCE_PRIO_EDAC. Therefore, the WARN_ON() will never be triggered, just delete it.
--- arch/x86/kernel/cpu/mce/core.c | 3 --- 1 file changed, 3 deletions(-)
arch/x86/kernel/cpu/mce/core.c +0 -3
@@ -162,9 +162,6 @@ EXPORT_SYMBOL_GPL(mce_log);void mce_register_decode_chain (struct notifier_block *nb) { -if (WARN_ON (nb->priority >MCE_PRIO_MCELOG && nb->priority <MCE_PRIO_EDAC )) -return ; -blocking_notifier_chain_register (&x86_mce_decoder_chain, nb); }EXPORT_SYMBOL_GPL (mce_register_decode_chain);
Signature · 1 line
2.26.0.106.g9fadedd
Borislav Petkov
maintainerQuoted 19 lines · Zhen Lei
enum
mce_notifier_prios{
MCE_PRIO_LOWEST,
MCE_PRIO_MCELOG,
MCE_PRIO_EDAC,After commit
c9c6d216ed28("x86/mce: Rename "first" function as "early""), there is no other integer betweenMCE_PRIO_MCELOGandMCE_PRIO_EDAC. Therefore, theWARN_ON()will never be triggered, just delete it.Signed-off-by Zhen Lei <[email protected]>--- arch/x86/kernel/cpu/mce/core.c | 3 --- 1 file changed, 3 deletions(-)arch/x86/kernel/cpu/mce/core.c +0
-0
arch/x86/kernel/cpu/mce/core.c EXPORT_SYMBOL_GPL(mce_log); · line 166
Quoted 5 lines
arch/x86/kernel/cpu/mce/core.c +0
-2@@ -162,9 +162,6 @@ EXPORT_SYMBOL_GPL(mce_log);void mce_register_decode_chain (struct notifier_block *nb) { -if (WARN_ON (nb->priority >MCE_PRIO_MCELOG && nb->priority <MCE_PRIO_EDAC )) -return ;
No, you don't want to remove it - you want to update it so that it catches wrong priorities...
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 21 lines · Borislav Petkov
Quoted 20 lines · Zhen Lei
enum
mce_notifier_prios{
MCE_PRIO_LOWEST,
MCE_PRIO_MCELOG,
MCE_PRIO_EDAC,After commit
c9c6d216ed28("x86/mce: Rename "first" function as "early""), there is no other integer betweenMCE_PRIO_MCELOGandMCE_PRIO_EDAC. Therefore, theWARN_ON()will never be triggered, just delete it.Signed-off-by Zhen Lei <[email protected]>--- arch/x86/kernel/cpu/mce/core.c | 3 --- 1 file changed, 3 deletions(-)arch/x86/kernel/cpu/mce/core.c +0
-0@@ -162,9 +162,6 @@ EXPORT_SYMBOL_GPL(mce_log);
Quoted 7 lines
arch/x86/kernel/cpu/mce/core.c EXPORT_SYMBOL_GPL(mce_log); · line 166
Quoted 4 lines
arch/x86/kernel/cpu/mce/core.c +0
-2void mce_register_decode_chain (struct notifier_block *nb) { -if (WARN_ON (nb->priority >MCE_PRIO_MCELOG && nb->priority <MCE_PRIO_EDAC )) -return ;No, you don't want to remove it - you want to update it so that it catches wrong priorities...
Oh, Yes, You're right. I will send v2.
Quoted 3 lines
Thx.