ACPICA: macros: fix ACPI_ERROR_NAMESPACE macro
authorErik Schmauss <erik.schmauss@intel.com>
Wed, 14 Mar 2018 23:13:05 +0000 (16:13 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 18 Mar 2018 17:52:00 +0000 (18:52 +0100)
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 <erik.schmauss@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/acmacros.h
drivers/acpi/acpica/evgpeblk.c
drivers/acpi/acpica/psobject.c
drivers/acpi/acpica/tbinstal.c

index 6463340..7e93540 100644 (file)
 #define ACPI_WARN_PREDEFINED(plist)         acpi_ut_predefined_warning plist
 #define ACPI_INFO_PREDEFINED(plist)         acpi_ut_predefined_info plist
 #define ACPI_BIOS_ERROR_PREDEFINED(plist)   acpi_ut_predefined_bios_error plist
+#define ACPI_ERROR_ONLY(s)                  s
 
 #else
 
 /* No error messages */
 
-#define ACPI_ERROR_NAMESPACE(s, e)
+#define ACPI_ERROR_NAMESPACE(s, p, e)
 #define ACPI_ERROR_METHOD(s, n, p, e)
 #define ACPI_WARN_PREDEFINED(plist)
 #define ACPI_INFO_PREDEFINED(plist)
 #define ACPI_BIOS_ERROR_PREDEFINED(plist)
+#define ACPI_ERROR_ONLY(s)
 
 #endif                         /* ACPI_NO_ERROR_MESSAGES */
 
index 107f3ec..b9139ca 100644 (file)
@@ -443,10 +443,10 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
        struct acpi_gpe_event_info *gpe_event_info;
        u32 gpe_enabled_count;
        u32 gpe_index;
-       u32 gpe_number;
        u32 i;
        u32 j;
        u8 *is_polling_needed = context;
+       ACPI_ERROR_ONLY(u32 gpe_number);
 
        ACPI_FUNCTION_TRACE(ev_initialize_gpe_block);
 
@@ -472,7 +472,9 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
 
                        gpe_index = (i * ACPI_GPE_REGISTER_WIDTH) + j;
                        gpe_event_info = &gpe_block->event_info[gpe_index];
-                       gpe_number = gpe_block->block_base_number + gpe_index;
+                       ACPI_ERROR_ONLY(gpe_number =
+                                       gpe_block->block_base_number +
+                                       gpe_index);
                        gpe_event_info->flags |= ACPI_GPE_INITIALIZED;
 
                        /*
index b18f1e0..70e3ea9 100644 (file)
@@ -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",
index 00be16d..95693e4 100644 (file)
@@ -231,11 +231,11 @@ release_and_exit:
 void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
 {
        acpi_status status;
-       char *override_type;
        struct acpi_table_desc new_table_desc;
        struct acpi_table_header *table;
        acpi_physical_address address;
        u32 length;
+       ACPI_ERROR_ONLY(char *override_type);
 
        /* (1) Attempt logical override (returns a logical address) */
 
@@ -244,7 +244,7 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
                acpi_tb_acquire_temp_table(&new_table_desc,
                                           ACPI_PTR_TO_PHYSADDR(table),
                                           ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
-               override_type = "Logical";
+               ACPI_ERROR_ONLY(override_type = "Logical");
                goto finish_override;
        }
 
@@ -255,7 +255,7 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
        if (ACPI_SUCCESS(status) && address && length) {
                acpi_tb_acquire_temp_table(&new_table_desc, address,
                                           ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
-               override_type = "Physical";
+               ACPI_ERROR_ONLY(override_type = "Physical");
                goto finish_override;
        }