[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v66Ws4WNPZbOYQvikKoozj_2WjzS-Jq-o2VxT77=k0vODw@mail.gmail.com>
Date: Mon, 29 Jun 2020 23:38:47 +0800
From: Chen-Yu Tsai <wens@...e.org>
To: Lee Jones <lee.jones@...aro.org>
Cc: linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Carlo Caione <carlo@...one.org>
Subject: Re: [PATCH 5/5] mfd: axp20x-i2c: Do not define 'struct
acpi_device_id' when !CONFIG_ACPI
Adding Hans to the list as he's the one that deals with all the x86
platforms that use this series of chips.
On Mon, Jun 29, 2020 at 8:32 PM Lee Jones <lee.jones@...aro.org> wrote:
>
> Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI,
> struct axp20x_i2c_acpi_match becomes defined by unused.
>
> This squashes the current W=1 kernel builds warning:
>
> drivers/mfd/axp20x-i2c.c:82:36: warning: ‘axp20x_i2c_acpi_match’ defined but not used [-Wunused-const-variable=]
>
> Cc: Chen-Yu Tsai <wens@...e.org>
> Cc: Carlo Caione <carlo@...one.org>
> Signed-off-by: Lee Jones <lee.jones@...aro.org>
> ---
> drivers/mfd/axp20x-i2c.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mfd/axp20x-i2c.c b/drivers/mfd/axp20x-i2c.c
> index 14f9df74f855c..3dd650125c239 100644
> --- a/drivers/mfd/axp20x-i2c.c
> +++ b/drivers/mfd/axp20x-i2c.c
> @@ -79,6 +79,7 @@ static const struct i2c_device_id axp20x_i2c_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, axp20x_i2c_id);
>
> +#if IS_ENABLED(CONFIG_ACPI)
> static const struct acpi_device_id axp20x_i2c_acpi_match[] = {
I'd rather use "__maybe_unused" if possible to at least get a compile
check, and also because "ACPI_PTR NULLifies the value" might not be
well known to people not working on ACPI-based platforms.
Either way,
Acked-by: Chen-Yu Tsai <wens@...e.org>
> {
> .id = "INT33F4",
> @@ -87,6 +88,7 @@ static const struct acpi_device_id axp20x_i2c_acpi_match[] = {
> { },
> };
> MODULE_DEVICE_TABLE(acpi, axp20x_i2c_acpi_match);
> +#endif
>
> static struct i2c_driver axp20x_i2c_driver = {
> .driver = {
> --
> 2.25.1
>
Powered by blists - more mailing lists