Skip to contentSkip to conversation

ACPI: fix undeclared symbols from saprse

PATCH In review Ben Dooks 2 participants 2 messages Jul 3, 2023 – Jul 4, 2023

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 ACPI: fix undeclared symbols from saprse

The building of drivers/acpi/acpica/utglobal.o is throwing a number of sparse warnins about undeclared symbols. This is due to defining DEFINE_ACPI_GLOBALS then making the macro ACPI_INIT_GLOBAL() define it but never declaring the fact this is an extern declared varible.

This is some of the sparse warnings that are being fixed here:

drivers/acpi/acpica/utglobal.c: note: in included file (through include/acpi/acpi.h):
./include/acpi/acpixf.h:104:1: warning: symbol 'acpi_gbl_enable_interpreter_slack' was not declared. Should it be static? ./include/acpi/acpixf.h:113:1: warning: symbol 'acpi_gbl_auto_serialize_methods' was not declared. Should it be static? ./include/acpi/acpixf.h:120:1: warning: symbol 'acpi_gbl_create_osi_method' was not declared. Should it be static? ./include/acpi/acpixf.h:126:1: warning: symbol 'acpi_gbl_use_default_register_widths' was not declared. Should it be static? ./include/acpi/acpixf.h:136:1: warning: symbol 'acpi_gbl_enable_table_validation' was not declared. Should it be static? ./include/acpi/acpixf.h:141:1: warning: symbol 'acpi_gbl_enable_aml_debug_object' was not declared. Should it be static? ./include/acpi/acpixf.h:149:1: warning: symbol 'acpi_gbl_copy_dsdt_locally' was not declared. Should it be static? ./include/acpi/acpixf.h:157:1: warning: symbol 'acpi_gbl_do_not_use_xsdt' was not declared. Should it be static?

---
Note, if this isn't the correct place to fix, where should this be going?

---
 include/acpi/acpixf.h | 1 +
 1 file changed, 1 insertion(+)
include/acpi/acpixf.h +1 -0
index 9ffdc0425bc2..8d69d1e39cd9 100644
@@ -37,6 +37,7 @@
 	type name
 
 #define ACPI_INIT_GLOBAL(type,name,value) \
+	extern type name; \
 	type name=value
 
 #else
Signature · 1 line
2.40.1
#1 lore raw
Quoted 19 lines · Ben Dooks

The building of drivers/acpi/acpica/utglobal.o is throwing a number of sparse warnins about undeclared symbols. This is due to defining DEFINE_ACPI_GLOBALS then making the macro ACPI_INIT_GLOBAL() define it but never declaring the fact this is an extern declared varible.

This is some of the sparse warnings that are being fixed here:

drivers/acpi/acpica/utglobal.c: note: in included file (through include/acpi/acpi.h):
./include/acpi/acpixf.h:104:1: warning: symbol 'acpi_gbl_enable_interpreter_slack' was not declared. Should it be static? ./include/acpi/acpixf.h:113:1: warning: symbol 'acpi_gbl_auto_serialize_methods' was not declared. Should it be static? ./include/acpi/acpixf.h:120:1: warning: symbol 'acpi_gbl_create_osi_method' was not declared. Should it be static? ./include/acpi/acpixf.h:126:1: warning: symbol 'acpi_gbl_use_default_register_widths' was not declared. Should it be static? ./include/acpi/acpixf.h:136:1: warning: symbol 'acpi_gbl_enable_table_validation' was not declared. Should it be static? ./include/acpi/acpixf.h:141:1: warning: symbol 'acpi_gbl_enable_aml_debug_object' was not declared. Should it be static? ./include/acpi/acpixf.h:149:1: warning: symbol 'acpi_gbl_copy_dsdt_locally' was not declared. Should it be static? ./include/acpi/acpixf.h:157:1: warning: symbol 'acpi_gbl_do_not_use_xsdt' was not declared. Should it be static?

Quoted 4 lines

---
Note, if this isn't the correct place to fix, where should this be going?

This file belongs to ACPICA. As a general rule, ACPICA changes should be submitted as pull requests to the upstream ACPICA project on GitHub, from where they are backported (semi-automatically) to Linux.

However, if an upstream ACPICA pull request has been submitted, a corresponding Linux patch can be posted with a Link: tag pointing to that pull request.

Thanks!

Quoted 19 lines
---
 include/acpi/acpixf.h | 1 +
 1 file changed, 1 insertion(+)
include/acpi/acpixf.h +1 -1
index 9ffdc0425bc2..8d69d1e39cd9 100644
@@ -37,6 +37,7 @@
        type name
 
 #define ACPI_INIT_GLOBAL(type,name,value) \
+       extern type name; \
        type name=value
 
 #else
--

2.40.1