acpi: remove nested "ifdef CONFIG_ACPI"
Subsystems (2)
PATCH 1/1 acpi: remove nested "ifdef CONFIG_ACPI"
In include/linux/acpi.h we have following ifdefs:
#ifndef _LINUX_ACPI_H #define _LINUX_ACPI_H #ifdef CONFIG_ACPI <=== #ifndef _LINUX #define _LINUX #endif #include <linux/list.h> #include <linux/mod_devicetable.h> #include <acpi/acpi.h> #include <acpi/acpi_bus.h> #include <acpi/acpi_drivers.h> #include <acpi/acpi_numa.h> #include <asm/acpi.h> #ifdef CONFIG_ACPI <===
The nesting of "ifdef CONFIG_ACPI" is kind of interesting. But I guess this was not intentional.(Or did I miss something?)
Attached is a patch to remove that nesting and to clean up this header a little bit.
Regards,
Andreas
--
[PATCH] acpi: remove nested "ifdef CONFIG_ACPI"
- Remove nested ifdef CONFIG_ACPI which required minor changes of the header.
- Remove unused function declaration for acpi_paddr_to_node. grep didn't find a usage of that function.
Signed-off-by Andreas Herrmann <[email protected]>
--- include/acpi/acpi_drivers.h | 3 +++ include/linux/acpi.h | 38 ++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-)
include/acpi/acpi_drivers.h +3 -0
@@ -29,6 +29,8 @@#include <linux/acpi.h> #include <acpi/acpi_bus.h> +#ifdef CONFIG_ACPI +#define ACPI_MAX_STRING 80#define ACPI_BUS_COMPONENT 0x00010000
@@ -149,4 +151,5 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle)-------------------------------------------------------------------------- */ extern int acpi_sleep_init (void ); +#endif /* CONFIG_ACPI */ #endif /*__ACPI_DRIVERS_H__*/
include/linux/acpi.h +18 -20
@@ -26,8 +26,6 @@#define _LINUX_ACPI_H -#ifdef CONFIG_ACPI -#ifndef _LINUX#define _LINUX#endif
@@ -125,6 +123,16 @@ extern unsigned long acpi_realmode_flags;#else /* !CONFIG_ACPI */ +static inline int acpi_boot_init (void ) +{ +return 0 ; +} + +static inline int acpi_boot_table_init (void ) +{ +return 0 ; +} +#define acpi_mp_config 0#endif /* !CONFIG_ACPI */
@@ -190,36 +198,26 @@ extern int acpi_blacklisted(void);extern void acpi_bios_year (char *s);#ifdef CONFIG_ACPI_NUMA +int acpi_get_pxm (acpi_handle handle);int acpi_get_node (acpi_handle *handle); -#else -static inline int acpi_get_pxm (acpi_handle handle) -{ -return 0 ; -} -static inline int acpi_get_node (acpi_handle *handle) -{ -return 0 ; -} -#endif -extern int acpi_paddr_to_node (u64 start_addr,u64 size); - -extern int pnpacpi_disabled;#define PXM_INVAL (-1)#define NID_INVAL (-1) -#else /* CONFIG_ACPI */ +#else -static inline int acpi_boot_init (void ) +static inline int acpi_get_pxm (acpi_handle handle) {return 0 ; } - -static inline int acpi_boot_table_init (void ) +static inline int acpi_get_node (acpi_handle *handle) {return 0 ; } -#endif /* CONFIG_ACPI */ +#endif /* !CONFIG_ACPI_NUMA */ + +extern int pnpacpi_disabled; +#endif /*_LINUX_ACPI_H*/
Signature · 1 line
1.5.3.4