]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPICA: Modify variable definition position
authorZhe Qiao <qiaozhe@iscas.ac.cn>
Fri, 12 Sep 2025 19:52:39 +0000 (21:52 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 15 Sep 2025 10:20:12 +0000 (12:20 +0200)
To prevent potential undefined risks.

Link: https://github.com/acpica/acpica/commit/efc4d8ab
Signed-off-by: Zhe Qiao <qiaozhe@iscas.ac.cn>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/psopinfo.c

index 1c8044ffcb97c51d7a26b7a2277dda7c6edee49f..5168b4a0467072e95777e61c7b79265f583327f8 100644 (file)
@@ -35,7 +35,7 @@ static const u8 acpi_gbl_argument_count[] =
 const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
 {
 #ifdef ACPI_DEBUG_OUTPUT
-       const char *opcode_name = "Unknown AML opcode";
+
 #endif
 
        ACPI_FUNCTION_NAME(ps_get_opcode_info);
@@ -62,6 +62,8 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
 #if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
 #include "asldefine.h"
 
+       const char *opcode_name = "Unknown AML opcode";
+
        switch (opcode) {
        case AML_RAW_DATA_BYTE:
                opcode_name = "-Raw Data Byte-";
@@ -102,11 +104,11 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
        default:
                break;
        }
-#endif
 
        /* Unknown AML opcode */
 
        ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%4.4X]\n", opcode_name, opcode));
+#endif
 
        return (&acpi_gbl_aml_op_info[_UNK]);
 }