The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Zhen Lei <thunder.leizhen@huawei.com>
Cc: Tony Luck <tony.luck@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, x86 <x86@kernel.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	linux-edac <linux-edac@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] x86/mce: remove unused WARN_ON() in mce_register_decode_chain()
Date: Fri, 6 Nov 2020 12:12:20 +0100	[thread overview]
Message-ID: <20201106111220.GA14914@zn.tnic> (raw)
In-Reply-To: <20201106084340.2009-1-thunder.leizhen@huawei.com>

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

  reply	other threads:[~2020-11-06 11:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2020-11-06 13:20   ` Leizhen (ThunderTown)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201106111220.GA14914@zn.tnic \
    --to=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thunder.leizhen@huawei.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox