summaryrefslogtreecommitdiff
path: root/include/acpi
diff options
context:
space:
mode:
authorLv Zheng <lv.zheng@intel.com>2014-07-16 12:58:53 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-07-23 03:10:45 +0400
commit417b4a73b62760db67512892c32f8acc008ab54e (patch)
tree9729e9eb4c52db8d3df5d3c68ab1cbe84643790e /include/acpi
parentf997ea54479e85076873a70fe53e66c9153e6f00 (diff)
downloadlinux-417b4a73b62760db67512892c32f8acc008ab54e.tar.xz
ACPI: Add support to force header inclusion rules for <acpi/acpi.h>.
As there is only CONFIG_ACPI=n processing in the <linux/acpi.h>, it is not safe to include <acpi/acpi.h> directly for source out of Linux ACPI subsystems. This patch adds error messaging to warn developers of such wrong inclusions. In order not to be bisected and reverted as a wrong commit, warning messages are carefully split into a seperate patch other than the wrong inclusion cleanups. Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/platform/aclinux.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index dfba35476b8a..1ba7c190c2cc 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -44,6 +44,16 @@
#ifndef __ACLINUX_H__
#define __ACLINUX_H__
+#ifdef __KERNEL__
+
+/* ACPICA external files should not include ACPICA headers directly. */
+
+#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H)
+#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
+#endif
+
+#endif
+
/* Common (in-kernel/user-space) ACPICA configuration */
#define ACPI_USE_SYSTEM_CLIBRARY