浏览代码

Back port of "ACPICA: Use designated initializers"

ACPICA commit 47538f5f0773c0820d8f552e20f6e77104290c01

The following commit is not correctly linuxized by its ACPICA form (see
link #1 for reference):
  Commit: 3d867f6c5fd6535cdeceef3170e5e84e5dd80fc1
  Subject: ACPICA: Use designated initializers
Thus breaks linuxize process.

This patch is a linuxized back port result of the upstreamed ACPICA
commit (see link #2 for reference).

Link: https://github.com/acpica/acpica/pull/248/       [#1]
Link: https://github.com/acpica/acpica/commit/47538f5f [#2]
Signed-off-by: Kees Cook <keescook@google.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Kees Cook 8 年之前
父节点
当前提交
99e597adf6
共有 3 个文件被更改,包括 14 次插入7 次删除
  1. 6 3
      drivers/acpi/acpica/hwxfsleep.c
  2. 5 4
      include/acpi/platform/acenv.h
  3. 3 0
      include/acpi/platform/aclinux.h

+ 6 - 3
drivers/acpi/acpica/hwxfsleep.c

@@ -72,13 +72,16 @@ static acpi_status acpi_hw_sleep_dispatch(u8 sleep_state, u32 function_id);
 static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
 static struct acpi_sleep_functions acpi_sleep_dispatch[] = {
 	{ACPI_STRUCT_INIT(legacy_function,
 	{ACPI_STRUCT_INIT(legacy_function,
 			  ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep)),
 			  ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_sleep)),
-	 ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_sleep) },
+	 ACPI_STRUCT_INIT(extended_function,
+			  acpi_hw_extended_sleep)},
 	{ACPI_STRUCT_INIT(legacy_function,
 	{ACPI_STRUCT_INIT(legacy_function,
 			  ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep)),
 			  ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake_prep)),
-	 ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_wake_prep) },
+	 ACPI_STRUCT_INIT(extended_function,
+			  acpi_hw_extended_wake_prep)},
 	{ACPI_STRUCT_INIT(legacy_function,
 	{ACPI_STRUCT_INIT(legacy_function,
 			  ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake)),
 			  ACPI_HW_OPTIONAL_FUNCTION(acpi_hw_legacy_wake)),
-	 ACPI_STRUCT_INIT(extended_function, acpi_hw_extended_wake) }
+	 ACPI_STRUCT_INIT(extended_function,
+			  acpi_hw_extended_wake)}
 };
 };
 
 
 /*
 /*

+ 5 - 4
include/acpi/platform/acenv.h

@@ -288,6 +288,11 @@
 #define ACPI_INLINE
 #define ACPI_INLINE
 #endif
 #endif
 
 
+/* Use ordered initialization if compiler doesn't support designated. */
+#ifndef ACPI_STRUCT_INIT
+#define ACPI_STRUCT_INIT(field, value)  value
+#endif
+
 /*
 /*
  * Configurable calling conventions:
  * Configurable calling conventions:
  *
  *
@@ -382,8 +387,4 @@
 #define ACPI_INIT_FUNCTION
 #define ACPI_INIT_FUNCTION
 #endif
 #endif
 
 
-#ifndef ACPI_STRUCT_INIT
-#define ACPI_STRUCT_INIT(field, value) value
-#endif
-
 #endif				/* __ACENV_H__ */
 #endif				/* __ACENV_H__ */

+ 3 - 0
include/acpi/platform/aclinux.h

@@ -178,6 +178,9 @@
 #define ACPI_MSG_BIOS_ERROR     KERN_ERR "ACPI BIOS Error (bug): "
 #define ACPI_MSG_BIOS_ERROR     KERN_ERR "ACPI BIOS Error (bug): "
 #define ACPI_MSG_BIOS_WARNING   KERN_WARNING "ACPI BIOS Warning (bug): "
 #define ACPI_MSG_BIOS_WARNING   KERN_WARNING "ACPI BIOS Warning (bug): "
 
 
+/*
+ * Linux wants to use designated initializers for function pointer structs.
+ */
 #define ACPI_STRUCT_INIT(field, value)	.field = value
 #define ACPI_STRUCT_INIT(field, value)	.field = value
 
 
 #else				/* !__KERNEL__ */
 #else				/* !__KERNEL__ */