diff options
author | Dongjiu Geng <gengdongjiu@huawei.com> | 2017-10-17 04:02:20 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@rjwysocki.net> | 2017-10-23 07:05:21 -0400 |
commit | c49870e89f4d2c21c76ebe90568246bb0f3572b7 (patch) | |
tree | 8051010b3db775ff57549af86ac3aadb9a211af3 | |
parent | 095f613c6b386a1704b73a549e9ba66c1d5381ae (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.c | 33 |
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 */ |
855 | static inline void ghes_sea_add(struct ghes *ghes) | 855 | static inline void ghes_sea_add(struct ghes *ghes) { } |
856 | { | 856 | static 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 | |||
861 | static 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 */ |
1067 | static inline void ghes_nmi_add(struct ghes *ghes) | 1058 | static inline void ghes_nmi_add(struct ghes *ghes) { } |
1068 | { | 1059 | static 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", | 1060 | static inline void ghes_nmi_init_cxt(void) { } |
1070 | ghes->generic->header.source_id); | ||
1071 | BUG(); | ||
1072 | } | ||
1073 | |||
1074 | static 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 | |||
1081 | static 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 | ||
1086 | static int ghes_probe(struct platform_device *ghes_dev) | 1063 | static int ghes_probe(struct platform_device *ghes_dev) |