Skip to content

Commit

Permalink
ACPI: Clean up inclusions of ACPI header files
Browse files Browse the repository at this point in the history
Replace direct inclusions of <acpi/acpi.h>, <acpi/acpi_bus.h> and
<acpi/acpi_drivers.h>, which are incorrect, with <linux/acpi.h>
inclusions and remove some inclusions of those files that aren't
necessary.

First of all, <acpi/acpi.h>, <acpi/acpi_bus.h> and <acpi/acpi_drivers.h>
should not be included directly from any files that are built for
CONFIG_ACPI unset, because that generally leads to build warnings about
undefined symbols in !CONFIG_ACPI builds.  For CONFIG_ACPI set,
<linux/acpi.h> includes those files and for CONFIG_ACPI unset it
provides stub ACPI symbols to be used in that case.

Second, there are ordering dependencies between those files that always
have to be met.  Namely, it is required that <acpi/acpi_bus.h> be included
prior to <acpi/acpi_drivers.h> so that the acpi_pci_root declarations the
latter depends on are always there.  And <acpi/acpi.h> which provides
basic ACPICA type declarations should always be included prior to any other
ACPI headers in CONFIG_ACPI builds.  That also is taken care of including
<linux/acpi.h> as appropriate.

Signed-off-by: Lv Zheng <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Matthew Garrett <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]> (drivers/pci stuff)
Acked-by: Konrad Rzeszutek Wilk <[email protected]> (Xen stuff)
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Lv Zheng authored and rafaeljw committed Dec 7, 2013
1 parent 6ce4eac commit 8b48463
Show file tree
Hide file tree
Showing 103 changed files with 80 additions and 234 deletions.
3 changes: 1 addition & 2 deletions arch/ia64/hp/common/aml_nfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
*/

#include <linux/module.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <asm/sal.h>

MODULE_AUTHOR("Bjorn Helgaas <[email protected]>");
Expand Down
4 changes: 1 addition & 3 deletions arch/x86/kernel/apic/apic_flat_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
#include <asm/apic.h>
#include <asm/ipi.h>

#ifdef CONFIG_ACPI
#include <acpi/acpi_bus.h>
#endif
#include <linux/acpi.h>

static struct apic apic_physflat;
static struct apic apic_flat;
Expand Down
3 changes: 0 additions & 3 deletions arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@
#include <linux/kthread.h>
#include <linux/jiffies.h> /* time_after() */
#include <linux/slab.h>
#ifdef CONFIG_ACPI
#include <acpi/acpi_bus.h>
#endif
#include <linux/bootmem.h>
#include <linux/dmar.h>
#include <linux/hpet.h>
Expand Down
1 change: 0 additions & 1 deletion arch/x86/pci/mmconfig_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <linux/rcupdate.h>
#include <asm/e820.h>
#include <asm/pci_x86.h>
#include <acpi/acpi.h>

/* Assume systems with more busses have correct MCFG */
#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
Expand Down
3 changes: 1 addition & 2 deletions arch/x86/platform/olpc/olpc-xo15-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#include <linux/power_supply.h>
#include <linux/olpc-ec.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <asm/olpc.h>

#define DRV_NAME "olpc-xo15-sci"
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>

#define PREFIX "ACPI: "

Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpi_extlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <linux/module.h>
#include <linux/acpi.h>
#include <acpi/acpi_bus.h>
#include <linux/cper.h>
#include <linux/ratelimit.h>
#include <asm/cpu.h>
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
#include <linux/cpu.h>
#include <linux/clockchips.h>
#include <linux/slab.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <asm/mwait.h>

#define ACPI_PROCESSOR_AGGREGATOR_CLASS "acpi_pad"
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/apei/einj.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <linux/nmi.h>
#include <linux/delay.h>
#include <linux/mm.h>
#include <acpi/acpi.h>

#include "apei-internal.h"

Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
#include <linux/suspend.h>
#include <asm/unaligned.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <linux/power_supply.h>

#define PREFIX "ACPI: "
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <acpi/acpi_bus.h>
#include <linux/dmi.h>

#include "internal.h"
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <asm/mpspec.h>
#endif
#include <linux/pci.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/apei.h>
#include <linux/dmi.h>
#include <linux/suspend.h>
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
#include <linux/seq_file.h>
#include <linux/input.h>
#include <linux/slab.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <acpi/button.h>

#define PREFIX "ACPI: "
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/custom_method.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <linux/kernel.h>
#include <linux/uaccess.h>
#include <linux/debugfs.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>

#include "internal.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <linux/export.h>
#include <linux/init.h>
#include <linux/debugfs.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>

#define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME("debugfs");
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
#include <linux/jiffies.h>
#include <linux/stddef.h>
#include <linux/acpi.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#define PREFIX "ACPI: "

Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <asm/io.h>

#include "internal.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <linux/init.h>
#include <linux/poll.h>
#include <linux/gfp.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <net/netlink.h>
#include <net/genetlink.h>

Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
#include <linux/types.h>
#include <asm/uaccess.h>
#include <linux/thermal.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>

#define PREFIX "ACPI: "

Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/hed.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/hed.h>

static struct acpi_device_id acpi_hed_ids[] = {
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/errno.h>
#include <linux/acpi.h>
#include <linux/numa.h>
#include <acpi/acpi_bus.h>

#define PREFIX "ACPI: "

Expand Down
3 changes: 0 additions & 3 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
#include <asm/io.h>
#include <asm/uaccess.h>

#include <acpi/acpi.h>
#include <acpi/acpi_bus.h>
#include <acpi/processor.h>
#include "internal.h"

#define _COMPONENT ACPI_OS_SERVICES
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/pci_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <linux/pci.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#define PREFIX "ACPI: "

Expand Down
4 changes: 1 addition & 3 deletions drivers/acpi/pci_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
#include <linux/pci.h>
#include <linux/mutex.h>
#include <linux/slab.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>

#define PREFIX "ACPI: "

Expand Down
4 changes: 1 addition & 3 deletions drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
#include <linux/pci-aspm.h>
#include <linux/acpi.h>
#include <linux/slab.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/apei.h>
#include <acpi/apei.h> /* for acpi_hest_init() */

#include "internal.h"

Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/sysfs.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include "sleep.h"
#include "internal.h"

Expand Down
4 changes: 1 addition & 3 deletions drivers/acpi/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
#include <linux/export.h>
#include <linux/suspend.h>
#include <linux/bcd.h>
#include <linux/acpi.h>
#include <asm/uaccess.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#include "sleep.h"

#define _COMPONENT ACPI_SYSTEM_COMPONENT
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/processor_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include <linux/export.h>
#include <linux/dmi.h>
#include <linux/slab.h>

#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <acpi/processor.h>

#include "internal.h"
Expand Down
4 changes: 1 addition & 3 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/clockchips.h>
#include <linux/cpuidle.h>
#include <linux/syscore_ops.h>
#include <acpi/processor.h>

/*
* Include the apic definitions for x86 to have the APIC timer related defines
Expand All @@ -46,9 +47,6 @@
#include <asm/apic.h>
#endif

#include <acpi/acpi_bus.h>
#include <acpi/processor.h>

#define PREFIX "ACPI: "

#define ACPI_PROCESSOR_CLASS "processor"
Expand Down
7 changes: 2 additions & 5 deletions drivers/acpi/processor_perflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@
#include <linux/init.h>
#include <linux/cpufreq.h>
#include <linux/slab.h>

#include <linux/acpi.h>
#include <acpi/processor.h>
#ifdef CONFIG_X86
#include <asm/cpufeature.h>
#endif

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/processor.h>

#define PREFIX "ACPI: "

#define ACPI_PROCESSOR_CLASS "processor"
Expand Down
7 changes: 2 additions & 5 deletions drivers/acpi/processor_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@
#include <linux/module.h>
#include <linux/init.h>
#include <linux/cpufreq.h>

#include <asm/uaccess.h>

#include <acpi/acpi_bus.h>
#include <linux/acpi.h>
#include <acpi/processor.h>
#include <acpi/acpi_drivers.h>
#include <asm/uaccess.h>

#define PREFIX "ACPI: "

Expand Down
7 changes: 2 additions & 5 deletions drivers/acpi/processor_throttling.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/cpufreq.h>

#include <linux/acpi.h>
#include <acpi/processor.h>
#include <asm/io.h>
#include <asm/uaccess.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/processor.h>

#define PREFIX "ACPI: "

#define ACPI_PROCESSOR_CLASS "processor"
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/sbshc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
* the Free Software Foundation version 2.
*/

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/delay.h>
Expand Down
2 changes: 0 additions & 2 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
#include <linux/dmi.h>
#include <linux/nls.h>

#include <acpi/acpi_drivers.h>

#include "internal.h"

#define _COMPONENT ACPI_BUS_COMPONENT
Expand Down
4 changes: 0 additions & 4 deletions drivers/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@
#include <linux/reboot.h>
#include <linux/acpi.h>
#include <linux/module.h>

#include <asm/io.h>

#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

#include "internal.h"
#include "sleep.h"

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/moduleparam.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>

#include "internal.h"

Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@
#include <linux/kmod.h>
#include <linux/reboot.h>
#include <linux/device.h>
#include <asm/uaccess.h>
#include <linux/thermal.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <asm/uaccess.h>

#define PREFIX "ACPI: "

Expand Down
Loading

0 comments on commit 8b48463

Please sign in to comment.