Skip to content

Commit

Permalink
rasdaemon: Fix mem_fail_event build breakage
Browse files Browse the repository at this point in the history
Commit 566a526 ("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: 566a526 ("add mem_fail_event trigger")
Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
  • Loading branch information
Avadhut Naik committed Aug 19, 2024
1 parent 6250251 commit da0cff3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ras-events.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da0cff3

Please sign in to comment.