Skip to content

Commit 0fe0beb

Browse files
Erik Schmaussrafaeljw
authored andcommitted
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 <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 34f206f commit 0fe0beb

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

drivers/acpi/acpica/acmacros.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,16 +460,18 @@
460460
#define ACPI_WARN_PREDEFINED(plist) acpi_ut_predefined_warning plist
461461
#define ACPI_INFO_PREDEFINED(plist) acpi_ut_predefined_info plist
462462
#define ACPI_BIOS_ERROR_PREDEFINED(plist) acpi_ut_predefined_bios_error plist
463+
#define ACPI_ERROR_ONLY(s) s
463464

464465
#else
465466

466467
/* No error messages */
467468

468-
#define ACPI_ERROR_NAMESPACE(s, e)
469+
#define ACPI_ERROR_NAMESPACE(s, p, e)
469470
#define ACPI_ERROR_METHOD(s, n, p, e)
470471
#define ACPI_WARN_PREDEFINED(plist)
471472
#define ACPI_INFO_PREDEFINED(plist)
472473
#define ACPI_BIOS_ERROR_PREDEFINED(plist)
474+
#define ACPI_ERROR_ONLY(s)
473475

474476
#endif /* ACPI_NO_ERROR_MESSAGES */
475477

drivers/acpi/acpica/evgpeblk.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,10 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
443443
struct acpi_gpe_event_info *gpe_event_info;
444444
u32 gpe_enabled_count;
445445
u32 gpe_index;
446-
u32 gpe_number;
447446
u32 i;
448447
u32 j;
449448
u8 *is_polling_needed = context;
449+
ACPI_ERROR_ONLY(u32 gpe_number);
450450

451451
ACPI_FUNCTION_TRACE(ev_initialize_gpe_block);
452452

@@ -472,7 +472,9 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
472472

473473
gpe_index = (i * ACPI_GPE_REGISTER_WIDTH) + j;
474474
gpe_event_info = &gpe_block->event_info[gpe_index];
475-
gpe_number = gpe_block->block_base_number + gpe_index;
475+
ACPI_ERROR_ONLY(gpe_number =
476+
gpe_block->block_base_number +
477+
gpe_index);
476478
gpe_event_info->flags |= ACPI_GPE_INITIALIZED;
477479

478480
/*

drivers/acpi/acpica/psobject.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state);
6767

6868
static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
6969
{
70-
u32 aml_offset;
70+
ACPI_ERROR_ONLY(u32 aml_offset);
7171

7272
ACPI_FUNCTION_TRACE_PTR(ps_get_aml_opcode, walk_state);
7373

@@ -98,9 +98,11 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
9898
/* The opcode is unrecognized. Complain and skip unknown opcodes */
9999

100100
if (walk_state->pass_number == 2) {
101-
aml_offset = (u32)ACPI_PTR_DIFF(walk_state->aml,
102-
walk_state->
103-
parser_state.aml_start);
101+
ACPI_ERROR_ONLY(aml_offset =
102+
(u32)ACPI_PTR_DIFF(walk_state->aml,
103+
walk_state->
104+
parser_state.
105+
aml_start));
104106

105107
ACPI_ERROR((AE_INFO,
106108
"Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",

drivers/acpi/acpica/tbinstal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ acpi_tb_install_standard_table(acpi_physical_address address,
231231
void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
232232
{
233233
acpi_status status;
234-
char *override_type;
235234
struct acpi_table_desc new_table_desc;
236235
struct acpi_table_header *table;
237236
acpi_physical_address address;
238237
u32 length;
238+
ACPI_ERROR_ONLY(char *override_type);
239239

240240
/* (1) Attempt logical override (returns a logical address) */
241241

@@ -244,7 +244,7 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
244244
acpi_tb_acquire_temp_table(&new_table_desc,
245245
ACPI_PTR_TO_PHYSADDR(table),
246246
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
247-
override_type = "Logical";
247+
ACPI_ERROR_ONLY(override_type = "Logical");
248248
goto finish_override;
249249
}
250250

@@ -255,7 +255,7 @@ void acpi_tb_override_table(struct acpi_table_desc *old_table_desc)
255255
if (ACPI_SUCCESS(status) && address && length) {
256256
acpi_tb_acquire_temp_table(&new_table_desc, address,
257257
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
258-
override_type = "Physical";
258+
ACPI_ERROR_ONLY(override_type = "Physical");
259259
goto finish_override;
260260
}
261261

0 commit comments

Comments
 (0)