[PATCH] acpi: remove nested "ifdef CONFIG_ACPI"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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(-)

diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index f85f77a..8420ff7 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -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__*/
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 8ccedf7..0546684 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -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*/
-- 
1.5.3.4




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux