aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDongjiu Geng <gengdongjiu@huawei.com>2017-10-17 04:02:20 -0400
committerRafael J. Wysocki <rjw@rjwysocki.net>2017-10-23 07:05:21 -0400
commitc49870e89f4d2c21c76ebe90568246bb0f3572b7 (patch)
tree8051010b3db775ff57549af86ac3aadb9a211af3
parent095f613c6b386a1704b73a549e9ba66c1d5381ae (diff)
ACPI / APEI: remove the unused dead-code for SEA/NMI notification type
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. Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com> Tested-by: Tyler Baicar <tbaicar@codeaurora.org> Reviewed-by: Borislav Petkov <bp@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/apei/ghes.c33
1 files changed, 5 insertions, 28 deletions
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 69ef0b6bf25d..cb7aceae3553 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -852,17 +852,8 @@ static void ghes_sea_remove(struct ghes *ghes)
852 synchronize_rcu(); 852 synchronize_rcu();
853} 853}
854#else /* CONFIG_ACPI_APEI_SEA */ 854#else /* CONFIG_ACPI_APEI_SEA */
855static inline void ghes_sea_add(struct ghes *ghes) 855static inline void ghes_sea_add(struct ghes *ghes) { }
856{ 856static inline void ghes_sea_remove(struct ghes *ghes) { }
857 pr_err(GHES_PFX "ID: %d, trying to add SEA notification which is not supported\n",
858 ghes->generic->header.source_id);
859}
860
861static inline void ghes_sea_remove(struct ghes *ghes)
862{
863 pr_err(GHES_PFX "ID: %d, trying to remove SEA notification which is not supported\n",
864 ghes->generic->header.source_id);
865}
866#endif /* CONFIG_ACPI_APEI_SEA */ 857#endif /* CONFIG_ACPI_APEI_SEA */
867 858
868#ifdef CONFIG_HAVE_ACPI_APEI_NMI 859#ifdef CONFIG_HAVE_ACPI_APEI_NMI
@@ -1064,23 +1055,9 @@ static void ghes_nmi_init_cxt(void)
1064 init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq); 1055 init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
1065} 1056}
1066#else /* CONFIG_HAVE_ACPI_APEI_NMI */ 1057#else /* CONFIG_HAVE_ACPI_APEI_NMI */
1067static inline void ghes_nmi_add(struct ghes *ghes) 1058static inline void ghes_nmi_add(struct ghes *ghes) { }
1068{ 1059static inline void ghes_nmi_remove(struct ghes *ghes) { }
1069 pr_err(GHES_PFX "ID: %d, trying to add NMI notification which is not supported!\n", 1060static inline void ghes_nmi_init_cxt(void) { }
1070 ghes->generic->header.source_id);
1071 BUG();
1072}
1073
1074static inline void ghes_nmi_remove(struct ghes *ghes)
1075{
1076 pr_err(GHES_PFX "ID: %d, trying to remove NMI notification which is not supported!\n",
1077 ghes->generic->header.source_id);
1078 BUG();
1079}
1080
1081static inline void ghes_nmi_init_cxt(void)
1082{
1083}
1084#endif /* CONFIG_HAVE_ACPI_APEI_NMI */ 1061#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
1085 1062
1086static int ghes_probe(struct platform_device *ghes_dev) 1063static int ghes_probe(struct platform_device *ghes_dev)