From da0cff3baaad2676bd24601a3f9d76a7faf5fa35 Mon Sep 17 00:00:00 2001 From: Avadhut Naik Date: Fri, 16 Aug 2024 18:10:40 +0000 Subject: [PATCH] rasdaemon: Fix mem_fail_event build breakage Commit 566a52622b1d ("add mem_fail_event trigger") introduces an event trigger for a memory failure event. However, if the rasdaemon is not configured with enable-memory-failure, the setup function of the trigger, mem_fail_event_trigger_setup(), will result in an undefined reference linker error when called through setup_event_trigger(). Ensure that the setup function for the trigger is called only when the rasdaemon has been configured with enable-memory-failure. Fixes: 566a52622b1d ("add mem_fail_event trigger") Signed-off-by: Avadhut Naik --- ras-events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ras-events.c b/ras-events.c index b6e80b2..c60e976 100644 --- a/ras-events.c +++ b/ras-events.c @@ -55,7 +55,9 @@ char *choices_disable; static const struct event_trigger event_triggers[] = { { "mc_event", &mc_event_trigger_setup }, +#ifdef HAVE_MEMORY_FAILURE { "memory_failure_event", &mem_fail_event_trigger_setup }, +#endif }; static int get_debugfs_dir(char *tracing_dir, size_t len)