Skip to contentSkip to conversation

ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode

PATCH Applied Nathan Chancellor 3 participants 4 messages Dec 20, 2018 – Dec 21, 2018 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode

Clang warns:

drivers/acpi/tables.c:715:14: warning: unused variable 'amlcode' [-Wunused-variable]

static void *amlcode __attribute__ ((weakref("AmlCode")));
             ^
drivers/acpi/tables.c:716:14: warning: unused variable 'dsdt_amlcode'
[-Wunused-variable]
static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
             ^

2 warnings generated.

The only uses of these variables are hiddem behind CONFIG_ACPI_CUSTOM_DSDT so do the same thing here.

Fixes 82e4eb4e9653 ("ACPI / tables: add DSDT AmlCode new declaration name support")
---
 drivers/acpi/tables.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/tables.c +2 -0
index ccb90eff00e5..48eabb6c2d4f 100644
@@ -712,8 +712,10 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
 					  table_length);
 }
 
+#ifdef CONFIG_ACPI_CUSTOM_DSDT
 static void *amlcode __attribute__ ((weakref("AmlCode")));
 static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
+#endif
 
 acpi_status
 acpi_os_table_override(struct acpi_table_header *existing_table,
Signature · 1 line
2.20.1
#1 lore raw
Quoted 39 lines · Nathan Chancellor

Clang warns:

drivers/acpi/tables.c:715:14: warning: unused variable 'amlcode' [-Wunused-variable]

static void *amlcode __attribute__ ((weakref("AmlCode")));
             ^
drivers/acpi/tables.c:716:14: warning: unused variable 'dsdt_amlcode'
[-Wunused-variable]
static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
             ^

2 warnings generated.

The only uses of these variables are hiddem behind CONFIG_ACPI_CUSTOM_DSDT so do the same thing here.

Fixes 82e4eb4e9653 ("ACPI / tables: add DSDT AmlCode new declaration name support")
---
 drivers/acpi/tables.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/tables.c +2 -0
index ccb90eff00e5..48eabb6c2d4f 100644
@@ -712,8 +712,10 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
 					  table_length);
 }
 
+#ifdef CONFIG_ACPI_CUSTOM_DSDT
 static void *amlcode __attribute__ ((weakref("AmlCode")));
 static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
+#endif
 
 acpi_status
 acpi_os_table_override(struct acpi_table_header *existing_table,
Signature · 1 line
2.20.1

+ Nick for review

#2 lore raw
Quoted 31 lines · Nathan Chancellor
Quoted 29 lines · Nathan Chancellor

Clang warns:

drivers/acpi/tables.c:715:14: warning: unused variable 'amlcode' [-Wunused-variable]

static void *amlcode __attribute__ ((weakref("AmlCode")));
             ^
drivers/acpi/tables.c:716:14: warning: unused variable 'dsdt_amlcode'
[-Wunused-variable]
static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
             ^

2 warnings generated.

The only uses of these variables are hiddem behind CONFIG_ACPI_CUSTOM_DSDT so do the same thing here.

Fixes 82e4eb4e9653 ("ACPI / tables: add DSDT AmlCode new declaration name support")
---
 drivers/acpi/tables.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/tables.c +0 -0
index ccb90eff00e5..48eabb6c2d4f 100644
@@ -712,8 +712,10 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
                                        table_length);
 }
 
Quoted 4 lines

drivers/acpi/tables.c acpi_os_physical_table_override(struct acpi_table_header *existing_table, · line 718

Quoted 4 lines
drivers/acpi/tables.c +2 -0
+#ifdef CONFIG_ACPI_CUSTOM_DSDT
 static void *amlcode __attribute__ ((weakref("AmlCode")));
 static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
+#endif

Thanks for this patch Nathan. I'm curious if rather than adding a second set of preprocessor guards, we could simply move the declaration of these 2 variables closer to their use, putting them in the existing preprocessor guards from 82e4eb4e9653?

Signature · 2 lines
Thanks,
~Nick Desaulniers
#3 lore raw
In reply to Nathan Chancellor
Quoted 27 lines · CET Nathan Chancellor

Clang warns:

drivers/acpi/tables.c:715:14: warning: unused variable 'amlcode' [-Wunused-variable]

static void *amlcode __attribute__ ((weakref("AmlCode")));
             ^
drivers/acpi/tables.c:716:14: warning: unused variable 'dsdt_amlcode'
[-Wunused-variable]
static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
             ^

2 warnings generated.

The only uses of these variables are hiddem behind CONFIG_ACPI_CUSTOM_DSDT so do the same thing here.

Fixes 82e4eb4e9653 ("ACPI / tables: add DSDT AmlCode new declaration name support")
---
 drivers/acpi/tables.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/acpi/tables.c +0 -0
index ccb90eff00e5..48eabb6c2d4f 100644

drivers/acpi/tables.c acpi_os_physical_table_override(struct acpi_table_header *existing_table, · line 721

Quoted 10 lines
drivers/acpi/tables.c +2 -0
@@ -712,8 +712,10 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
 					  table_length);
 }
 
+#ifdef CONFIG_ACPI_CUSTOM_DSDT
 static void *amlcode __attribute__ ((weakref("AmlCode")));
 static void *dsdt_amlcode __attribute__ ((weakref("dsdt_aml_code")));
+#endif
 
 acpi_status
 acpi_os_table_override(struct acpi_table_header *existing_table,

Applied, thanks!