[PATCH v4 1/2] RAS: ACPI: APEI: add conditional compilation to ARM specific error reporting routines.

From: Daniel Ferguson
Date: Mon Feb 26 2024 - 15:16:40 EST


Conditional compilation directives were added in some places to
prevent the unnecessary inclusion of ARM specific RAS error handling
routines in non-ARM platforms.

Signed-off-by: Daniel Ferguson <danielf@xxxxxxxxxxxxxxxxxxxxxx>
---
drivers/acpi/apei/ghes.c | 4 ++++
drivers/ras/ras.c | 2 ++
include/linux/ras.h | 4 ++++
3 files changed, 10 insertions(+)

diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index fe825a432c5b..5980f70ca0e4 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -526,6 +526,7 @@ static bool ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata,
return false;
}

+#if defined(CONFIG_ARM) || defined (CONFIG_ARM64)
static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,
int sev, bool sync)
{
@@ -571,6 +572,7 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,

return queued;
}
+#endif

/*
* PCIe AER errors need to be sent to the AER driver for reporting and
@@ -751,9 +753,11 @@ static bool ghes_do_proc(struct ghes *ghes,
}
else if (guid_equal(sec_type, &CPER_SEC_PCIE)) {
ghes_handle_aer(gdata);
+#if defined(CONFIG_ARM) || defined (CONFIG_ARM64)
}
else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) {
queued = ghes_handle_arm_hw_error(gdata, sev, sync);
+#endif
} else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) {
struct cxl_cper_event_rec *rec =
acpi_hest_get_payload(gdata);
diff --git a/drivers/ras/ras.c b/drivers/ras/ras.c
index 95540ea8dd9d..355c0d78bd50 100644
--- a/drivers/ras/ras.c
+++ b/drivers/ras/ras.c
@@ -21,10 +21,12 @@ void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id,
trace_non_standard_event(sec_type, fru_id, fru_text, sev, err, len);
}

+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
void log_arm_hw_error(struct cper_sec_proc_arm *err)
{
trace_arm_event(err);
}
+#endif

static int __init ras_init(void)
{
diff --git a/include/linux/ras.h b/include/linux/ras.h
index 1f4048bf2674..bded04044d33 100644
--- a/include/linux/ras.h
+++ b/include/linux/ras.h
@@ -24,15 +24,19 @@ int __init parse_cec_param(char *str);
void log_non_standard_event(const guid_t *sec_type,
const guid_t *fru_id, const char *fru_text,
const u8 sev, const u8 *err, const u32 len);
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
void log_arm_hw_error(struct cper_sec_proc_arm *err);
+#endif
#else
static inline void
log_non_standard_event(const guid_t *sec_type,
const guid_t *fru_id, const char *fru_text,
const u8 sev, const u8 *err, const u32 len)
{ return; }
+#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
static inline void
log_arm_hw_error(struct cper_sec_proc_arm *err) { return; }
#endif
+#endif

#endif /* __RAS_H__ */

--
2.43.0