From 0fe0bebf5fb905ae682b1ecfd0b51b3a89e45ee6 Mon Sep 17 00:00:00 2001 From: Erik Schmauss Date: Wed, 14 Mar 2018 16:13:05 -0700 Subject: ACPICA: macros: fix ACPI_ERROR_NAMESPACE macro Fixing the ACPI_ERROR_NAMESPACE macros created an "unused variable" compile error when ACPI_NO_ERROR_MESSAGES was defined. This commit also fixes the above compilation errors by surrounding variables meant for debugging inside a new ACPI_ERROR_ONLY macro. Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/psobject.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/acpi/acpica/psobject.c') diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c index b18f1e048985..70e3ea933edc 100644 --- a/drivers/acpi/acpica/psobject.c +++ b/drivers/acpi/acpica/psobject.c @@ -67,7 +67,7 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state); static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state) { - u32 aml_offset; + ACPI_ERROR_ONLY(u32 aml_offset); ACPI_FUNCTION_TRACE_PTR(ps_get_aml_opcode, walk_state); @@ -98,9 +98,11 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state) /* The opcode is unrecognized. Complain and skip unknown opcodes */ if (walk_state->pass_number == 2) { - aml_offset = (u32)ACPI_PTR_DIFF(walk_state->aml, - walk_state-> - parser_state.aml_start); + ACPI_ERROR_ONLY(aml_offset = + (u32)ACPI_PTR_DIFF(walk_state->aml, + walk_state-> + parser_state. + aml_start)); ACPI_ERROR((AE_INFO, "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring", -- cgit v1.2.3