Skip to content

Commit 08dc7c7

Browse files
Javier Martinez Canillasrafaeljw
authored andcommitted
ACPI: Fix build errors due objects compiled unconditionally
If the CONFIG_ACPI Kconfig symbol is not enabled and a partial build is attempted, compile errors will happen due missing types and identifiers. This can be easily reproduced with the following commands: $ export CROSS_COMPILE="arm-linux-gnueabihf-" ARCH=arm $ make allmodconfig $ make M=drivers/acpi/ CC drivers/acpi//tables.o drivers/acpi//tables.c:235:3: warning: 'struct acpi_subtable_proc' declared inside parameter list unsigned int max_entries) ^ drivers/acpi//tables.c:235:3: warning: its scope is only this definition or declaration, which is probably not what you want drivers/acpi//tables.c: In function 'acpi_parse_entries_array': drivers/acpi//tables.c:269:4: error: invalid use of undefined type 'struct acpi_subtable_proc' ... scripts/Makefile.build:258: recipe for target 'drivers/acpi//tables.o' failed make[1]: *** [drivers/acpi//tables.o] Error 1 Makefile:1401: recipe for target '_module_drivers/acpi/' failed make: *** [_module_drivers/acpi/] Error 2 This is because objects are tried to be built unconditionally even when CONFIG_ACPI is not enabled. This is usually not a problem since arches' Kconfig sources drivers/acpi/Kconfig directly and also selects ACPI but the Makefile should conditionally build the objects as well to prevent these build errors. Signed-off-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 527e931 commit 08dc7c7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/acpi/Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT
88
#
99
# ACPI Boot-Time Table Parsing
1010
#
11-
obj-y += tables.o
11+
obj-$(CONFIG_ACPI) += tables.o
1212
obj-$(CONFIG_X86) += blacklist.o
1313

1414
#
1515
# ACPI Core Subsystem (Interpreter)
1616
#
17-
obj-y += acpi.o \
17+
obj-$(CONFIG_ACPI) += acpi.o \
1818
acpica/
1919

2020
# All the builtin files are in the "acpi." module_param namespace.
@@ -66,10 +66,10 @@ obj-$(CONFIG_ACPI_FAN) += fan.o
6666
obj-$(CONFIG_ACPI_VIDEO) += video.o
6767
obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o
6868
obj-$(CONFIG_ACPI_PROCESSOR) += processor.o
69-
obj-y += container.o
69+
obj-$(CONFIG_ACPI) += container.o
7070
obj-$(CONFIG_ACPI_THERMAL) += thermal.o
7171
obj-$(CONFIG_ACPI_NFIT) += nfit.o
72-
obj-y += acpi_memhotplug.o
72+
obj-$(CONFIG_ACPI) += acpi_memhotplug.o
7373
obj-$(CONFIG_ACPI_HOTPLUG_IOAPIC) += ioapic.o
7474
obj-$(CONFIG_ACPI_BATTERY) += battery.o
7575
obj-$(CONFIG_ACPI_SBS) += sbshc.o

0 commit comments

Comments
 (0)