* [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode
@ 2018-12-20 19:38 Nathan Chancellor
2018-12-20 21:57 ` Nathan Chancellor
2018-12-21 11:16 ` Rafael J. Wysocki
0 siblings, 2 replies; 4+ messages in thread
From: Nathan Chancellor @ 2018-12-20 19:38 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown; +Cc: linux-acpi, linux-kernel, 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")
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/acpi/tables.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index ccb90eff00e5..48eabb6c2d4f 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -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,
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode
2018-12-20 19:38 [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode Nathan Chancellor
@ 2018-12-20 21:57 ` Nathan Chancellor
2018-12-21 17:55 ` Nick Desaulniers
2018-12-21 11:16 ` Rafael J. Wysocki
1 sibling, 1 reply; 4+ messages in thread
From: Nathan Chancellor @ 2018-12-20 21:57 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown; +Cc: linux-acpi, linux-kernel, Nick Desaulniers
On Thu, Dec 20, 2018 at 12:38:56PM -0700, Nathan Chancellor wrote:
> 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")
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> drivers/acpi/tables.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> index ccb90eff00e5..48eabb6c2d4f 100644
> --- a/drivers/acpi/tables.c
> +++ b/drivers/acpi/tables.c
> @@ -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,
> --
> 2.20.1
>
+ Nick for review
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode
2018-12-20 19:38 [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode Nathan Chancellor
2018-12-20 21:57 ` Nathan Chancellor
@ 2018-12-21 11:16 ` Rafael J. Wysocki
1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2018-12-21 11:16 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: Len Brown, linux-acpi, linux-kernel
On Thursday, December 20, 2018 8:38:56 PM CET Nathan Chancellor wrote:
> 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")
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
> drivers/acpi/tables.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> index ccb90eff00e5..48eabb6c2d4f 100644
> --- a/drivers/acpi/tables.c
> +++ b/drivers/acpi/tables.c
> @@ -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!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode
2018-12-20 21:57 ` Nathan Chancellor
@ 2018-12-21 17:55 ` Nick Desaulniers
0 siblings, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2018-12-21 17:55 UTC (permalink / raw)
To: Nathan Chancellor; +Cc: Rafael J. Wysocki, Len Brown, linux-acpi, LKML
On Thu, Dec 20, 2018 at 1:57 PM Nathan Chancellor
<natechancellor@gmail.com> wrote:
>
> On Thu, Dec 20, 2018 at 12:38:56PM -0700, Nathan Chancellor wrote:
> > 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")
> > Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> > ---
> > drivers/acpi/tables.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
> > index ccb90eff00e5..48eabb6c2d4f 100644
> > --- a/drivers/acpi/tables.c
> > +++ b/drivers/acpi/tables.c
> > @@ -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
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?
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-21 17:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-20 19:38 [PATCH] ACPI / tables: Add an ifdef around amlcode and dsdt_amlcode Nathan Chancellor
2018-12-20 21:57 ` Nathan Chancellor
2018-12-21 17:55 ` Nick Desaulniers
2018-12-21 11:16 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox