Skip to content

Commit a324e93

Browse files
committed
EDAC, skx: Fix randconfig builds
The driver depends on the ADXL component glue and selects it. However, ADXL itself implicitly depends on ACPI and in nonsensical randconfig builds like this: # CONFIG_ACPI is not set CONFIG_ACPI_ADXL=y where ACPI is not enabled, the build fails with: drivers/edac/skx_edac.o: In function `skx_mce_check_error': skx_edac.c:(.text+0xab): undefined reference to `adxl_decode' drivers/edac/skx_edac.o: In function `skx_init': skx_edac.c:(.init.text+0x8bf): undefined reference to `adxl_get_component_names' make: *** [vmlinux] Error 1 Add stubs for that case so that the build succeeds. CONFIG_ACPI=n doesn't make any sense for real configurations but this fix will at least silence randconfig builds. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Tony Luck <tony.luck@intel.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org>
1 parent ad6e160 commit a324e93

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

drivers/edac/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ config EDAC_SKX
234234
depends on PCI && X86_64 && X86_MCE_INTEL && PCI_MMCONFIG
235235
depends on ACPI_NFIT || !ACPI_NFIT # if ACPI_NFIT=m, EDAC_SKX can't be y
236236
select DMI
237-
select ACPI_ADXL
237+
select ACPI_ADXL if ACPI
238238
help
239239
Support for error detection and correction the Intel
240240
Skylake server Integrated Memory Controllers. If your

include/linux/adxl.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
#ifndef _LINUX_ADXL_H
88
#define _LINUX_ADXL_H
99

10+
#ifdef CONFIG_ACPI_ADXL
1011
const char * const *adxl_get_component_names(void);
1112
int adxl_decode(u64 addr, u64 component_values[]);
13+
#else
14+
static inline const char * const *adxl_get_component_names(void) { return NULL; }
15+
static inline int adxl_decode(u64 addr, u64 component_values[]) { return -EOPNOTSUPP; }
16+
#endif
1217

1318
#endif /* _LINUX_ADXL_H */

0 commit comments

Comments
 (0)