[PATCH v1 01/16] ACPICA: Modify variable definition position

Rafael J. Wysocki
2025-09-12T20:07:05Z

From: Zhe Qiao <qiaozhe@iscas.ac.cn>

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 | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index 1c8044ffcb97..5168b4a04670 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -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]);
}
--
2.51.0