From: Dongjiu Geng <gengdongjiu@huawei.com>
To: <bp@suse.de>, <tbaicar@codeaurora.org>, <james.morse@arm.com>,
<zjzhang@codeaurora.org>, <geliangtang@gmail.com>,
<andriy.shevchenko@linux.intel.com>, <tony.luck@intel.com>,
<austinwc@codeaurora.org>, <rjw@rjwysocki.net>, <lenb@kernel.org>,
<linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<gengdongjiu@huawei.com>, <linuxarm@huawei.com>,
<john.garry@huawei.com>, <shiju.jose@huawei.com>,
<zhengqiang10@huawei.com>, <wangxiongfeng2@huawei.com>
Cc: <huangshaoyu@huawei.com>, <wuquanming@huawei.com>
Subject: [PATCH v4 1/2] acpi: apei: remove the unused dead-code for SEA/NMI notification type
Date: Sun, 15 Oct 2017 16:56:57 +0800 [thread overview]
Message-ID: <1508057818-30608-1-git-send-email-gengdongjiu@huawei.com> (raw)
For the SEA notification, the two functions ghes_sea_add() and
ghes_sea_remove() are only called when CONFIG_ACPI_APEI_SEA
is defined. If not, it will return errors in the ghes_probe()
and not continue. If the probe is failed, the ghes_sea_remove()
also has no chance to be called. Hence, remove the unnecessary
handling when CONFIG_ACPI_APEI_SEA is not defined.
For the NMI notification, it has the same issue as SEA notification,
so also remove the unused dead-code for it.
Cc: Borislav Petkov <bp@suse.de>
Cc: Tyler Baicar <tbaicar@codeaurora.org>
Cc: James Morse <james.morse@arm.com>
Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
---
drivers/acpi/apei/ghes.c | 33 +++++----------------------------
1 file changed, 5 insertions(+), 28 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index d661d45..3eee30a 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -849,17 +849,8 @@ static void ghes_sea_remove(struct ghes *ghes)
synchronize_rcu();
}
#else /* CONFIG_ACPI_APEI_SEA */
-static inline void ghes_sea_add(struct ghes *ghes)
-{
- pr_err(GHES_PFX "ID: %d, trying to add SEA notification which is not supported\n",
- ghes->generic->header.source_id);
-}
-
-static inline void ghes_sea_remove(struct ghes *ghes)
-{
- pr_err(GHES_PFX "ID: %d, trying to remove SEA notification which is not supported\n",
- ghes->generic->header.source_id);
-}
+static inline void ghes_sea_add(struct ghes *ghes) { }
+static inline void ghes_sea_remove(struct ghes *ghes) { }
#endif /* CONFIG_ACPI_APEI_SEA */
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
@@ -1061,23 +1052,9 @@ static void ghes_nmi_init_cxt(void)
init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
}
#else /* CONFIG_HAVE_ACPI_APEI_NMI */
-static inline void ghes_nmi_add(struct ghes *ghes)
-{
- pr_err(GHES_PFX "ID: %d, trying to add NMI notification which is not supported!\n",
- ghes->generic->header.source_id);
- BUG();
-}
-
-static inline void ghes_nmi_remove(struct ghes *ghes)
-{
- pr_err(GHES_PFX "ID: %d, trying to remove NMI notification which is not supported!\n",
- ghes->generic->header.source_id);
- BUG();
-}
-
-static inline void ghes_nmi_init_cxt(void)
-{
-}
+static inline void ghes_nmi_add(struct ghes *ghes) { }
+static inline void ghes_nmi_remove(struct ghes *ghes) { }
+static inline void ghes_nmi_init_cxt(void) { }
#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
static int ghes_probe(struct platform_device *ghes_dev)
--
2.10.1
next reply other threads:[~2017-10-15 8:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-15 8:56 Dongjiu Geng [this message]
2017-10-15 8:56 ` [PATCH v4 2/2] acpi: apei: Add SEI notification type support for ARMv8 Dongjiu Geng
2017-10-17 10:20 ` kbuild test robot
2017-10-17 10:34 ` gengdongjiu
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=1508057818-30608-1-git-send-email-gengdongjiu@huawei.com \
--to=gengdongjiu@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=austinwc@codeaurora.org \
--cc=bp@suse.de \
--cc=geliangtang@gmail.com \
--cc=huangshaoyu@huawei.com \
--cc=james.morse@arm.com \
--cc=john.garry@huawei.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=rjw@rjwysocki.net \
--cc=shiju.jose@huawei.com \
--cc=tbaicar@codeaurora.org \
--cc=tony.luck@intel.com \
--cc=wangxiongfeng2@huawei.com \
--cc=wuquanming@huawei.com \
--cc=zhengqiang10@huawei.com \
--cc=zjzhang@codeaurora.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
all inboxes | Powered by JetHome®