]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: Fix mem_fail_event build breakage
authorAvadhut Naik <avadhut.naik@amd.com>
Fri, 16 Aug 2024 18:10:40 +0000 (18:10 +0000)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 18 Nov 2024 12:25:43 +0000 (13:25 +0100)
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 <avadhut.naik@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-events.c

index fb405ca4192a069b4472bd4cc377fc6b3d3f3798..90228af2cfdd9d1b28805210bb1c2f12199bdf2d 100644 (file)
@@ -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)