linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] x86/mce: remove unused WARN_ON() in mce_register_decode_chain()
@ 2020-11-06  8:43 Zhen Lei
  2020-11-06 11:12 ` Borislav Petkov
  0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2020-11-06  8:43 UTC (permalink / raw)
  To: Tony Luck, Borislav Petkov, Thomas Gleixner, Ingo Molnar, x86,
	H . Peter Anvin, linux-edac, linux-kernel
  Cc: 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 between MCE_PRIO_MCELOG and MCE_PRIO_EDAC.
Therefore, the WARN_ON() will never be triggered, just delete it.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 arch/x86/kernel/cpu/mce/core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 4102b866e7c0..914f9f102995 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -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);
-- 
2.26.0.106.g9fadedd



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] x86/mce: remove unused WARN_ON() in mce_register_decode_chain()
  2020-11-06  8:43 [PATCH 1/1] x86/mce: remove unused WARN_ON() in mce_register_decode_chain() Zhen Lei
@ 2020-11-06 11:12 ` Borislav Petkov
  2020-11-06 13:20   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 3+ messages in thread
From: Borislav Petkov @ 2020-11-06 11:12 UTC (permalink / raw)
  To: Zhen Lei
  Cc: Tony Luck, Thomas Gleixner, Ingo Molnar, x86, H . Peter Anvin,
	linux-edac, linux-kernel

On Fri, Nov 06, 2020 at 04:43:40PM +0800, Zhen Lei wrote:
> 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.
> 
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  arch/x86/kernel/cpu/mce/core.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
> index 4102b866e7c0..914f9f102995 100644
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -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.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] x86/mce: remove unused WARN_ON() in mce_register_decode_chain()
  2020-11-06 11:12 ` Borislav Petkov
@ 2020-11-06 13:20   ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 3+ messages in thread
From: Leizhen (ThunderTown) @ 2020-11-06 13:20 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Tony Luck, Thomas Gleixner, Ingo Molnar, x86, H . Peter Anvin,
	linux-edac, linux-kernel



On 2020/11/6 19:12, Borislav Petkov wrote:
> On Fri, Nov 06, 2020 at 04:43:40PM +0800, Zhen Lei wrote:
>> 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.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  arch/x86/kernel/cpu/mce/core.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
>> index 4102b866e7c0..914f9f102995 100644
>> --- a/arch/x86/kernel/cpu/mce/core.c
>> +++ b/arch/x86/kernel/cpu/mce/core.c
>> @@ -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...

Oh, Yes, You're right. I will send v2.


> 
> Thx.
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-06 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  8:43 [PATCH 1/1] x86/mce: remove unused WARN_ON() in mce_register_decode_chain() Zhen Lei
2020-11-06 11:12 ` Borislav Petkov
2020-11-06 13:20   ` Leizhen (ThunderTown)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).