Skip to content

Commit c49870e

Browse files
gengdongjiu1rafaeljw
authored andcommitted
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 <[email protected]> Tested-by: Tyler Baicar <[email protected]> Reviewed-by: Borislav Petkov <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 095f613 commit c49870e

File tree

1 file changed

+5
-28
lines changed

1 file changed

+5
-28
lines changed

drivers/acpi/apei/ghes.c

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -852,17 +852,8 @@ static void ghes_sea_remove(struct ghes *ghes)
852852
synchronize_rcu();
853853
}
854854
#else /* CONFIG_ACPI_APEI_SEA */
855-
static inline void ghes_sea_add(struct ghes *ghes)
856-
{
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-
}
855+
static inline void ghes_sea_add(struct ghes *ghes) { }
856+
static inline void ghes_sea_remove(struct ghes *ghes) { }
866857
#endif /* CONFIG_ACPI_APEI_SEA */
867858

868859
#ifdef CONFIG_HAVE_ACPI_APEI_NMI
@@ -1064,23 +1055,9 @@ static void ghes_nmi_init_cxt(void)
10641055
init_irq_work(&ghes_proc_irq_work, ghes_proc_in_irq);
10651056
}
10661057
#else /* CONFIG_HAVE_ACPI_APEI_NMI */
1067-
static inline void ghes_nmi_add(struct ghes *ghes)
1068-
{
1069-
pr_err(GHES_PFX "ID: %d, trying to add NMI notification which is not supported!\n",
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-
}
1058+
static inline void ghes_nmi_add(struct ghes *ghes) { }
1059+
static inline void ghes_nmi_remove(struct ghes *ghes) { }
1060+
static inline void ghes_nmi_init_cxt(void) { }
10841061
#endif /* CONFIG_HAVE_ACPI_APEI_NMI */
10851062

10861063
static int ghes_probe(struct platform_device *ghes_dev)

0 commit comments

Comments
 (0)