linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiaochun Lee <lixiaochun.2888@163.com>
To: tony.luck@intel.com, bp@alien8.de
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, linux-edac@vger.kernel.org,
	linux-kernel@vger.kernel.org, lixiaochun.2888@163.com,
	Xiaochun Lee <lixc17@lenovo.com>
Subject: [PATCH] x86/mce: add a switch of CONFIG_X86_MCELOG_LEGACY
Date: Wed, 11 Sep 2019 23:28:50 +0800	[thread overview]
Message-ID: <1568215730-11471-1-git-send-email-lixiaochun.2888@163.com> (raw)

From: Xiaochun Lee <lixc17@lenovo.com>

Add CONFIG_X86_MCELOG_LEGACY to control the
behavior of several functions be compiled.

Signed-off-by: Xiaochun Lee <lixc17@lenovo.com>
---
 arch/x86/kernel/cpu/mce/dev-mcelog.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mce/dev-mcelog.c b/arch/x86/kernel/cpu/mce/dev-mcelog.c
index 7c8958d..6add0ce 100644
--- a/arch/x86/kernel/cpu/mce/dev-mcelog.c
+++ b/arch/x86/kernel/cpu/mce/dev-mcelog.c
@@ -82,7 +82,7 @@ static void mce_do_trigger(struct work_struct *work)
 
 static DECLARE_WORK(mce_trigger_work, mce_do_trigger);
 
-
+#ifdef CONFIG_X86_MCELOG_LEGACY
 void mce_work_trigger(void)
 {
 	if (mce_helper[0])
@@ -113,6 +113,7 @@ static ssize_t set_trigger(struct device *s, struct device_attribute *attr,
 }
 
 DEVICE_ATTR(trigger, 0644, show_trigger, set_trigger);
+#endif
 
 /*
  * mce_chrdev: Character device /dev/mcelog to read and clear the MCE log.
@@ -276,6 +277,7 @@ static long mce_chrdev_ioctl(struct file *f, unsigned int cmd,
 	}
 }
 
+#ifdef CONFIG_X86_MCELOG_LEGACY
 void mce_register_injector_chain(struct notifier_block *nb)
 {
 	blocking_notifier_chain_register(&mce_injector_chain, nb);
@@ -287,6 +289,7 @@ void mce_unregister_injector_chain(struct notifier_block *nb)
 	blocking_notifier_chain_unregister(&mce_injector_chain, nb);
 }
 EXPORT_SYMBOL_GPL(mce_unregister_injector_chain);
+#endif
 
 static ssize_t mce_chrdev_write(struct file *filp, const char __user *ubuf,
 				size_t usize, loff_t *off)
-- 
1.8.3.1



             reply	other threads:[~2019-09-11 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11 15:28 Xiaochun Lee [this message]
2019-09-11 15:40 ` [PATCH] x86/mce: add a switch of CONFIG_X86_MCELOG_LEGACY Borislav Petkov

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=1568215730-11471-1-git-send-email-lixiaochun.2888@163.com \
    --to=lixiaochun.2888@163.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixc17@lenovo.com \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).