[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230311122833.03b5a3d7@jic23-huawei>
Date: Sat, 11 Mar 2023 12:28:33 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc: Marek Vasut <marek.vasut@...il.com>,
Lars-Peter Clausen <lars@...afoo.de>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Robert Eshleman <bobbyeshleman@...il.com>,
linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] iio: proximity: sx9500: Mark ACPI and OF related
data as maybe unused
On Sat, 11 Mar 2023 12:14:57 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org> wrote:
> The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
> certain data unused:
>
> drivers/iio/proximity/sx9500.c:1039:34: error: ‘sx9500_of_match’ defined but not used [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Hi Krysztof
Thanks for looking at these warnings.
Drop the protection macros instead. The tables are trivial in size and
the of_match_ptr() breaks some ways this driver can be used.
ACPI_PTR() isn't as bad, but is pretty much pointless given this size of
the array.
Jonathan
> ---
> drivers/iio/proximity/sx9500.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/proximity/sx9500.c b/drivers/iio/proximity/sx9500.c
> index 8794e75e5bf9..840db1953998 100644
> --- a/drivers/iio/proximity/sx9500.c
> +++ b/drivers/iio/proximity/sx9500.c
> @@ -1036,13 +1036,13 @@ static const struct acpi_device_id sx9500_acpi_match[] = {
> };
> MODULE_DEVICE_TABLE(acpi, sx9500_acpi_match);
>
> -static const struct of_device_id sx9500_of_match[] = {
> +static const struct of_device_id sx9500_of_match[] __maybe_unused = {
> { .compatible = "semtech,sx9500", },
> { }
> };
> MODULE_DEVICE_TABLE(of, sx9500_of_match);
>
> -static const struct i2c_device_id sx9500_id[] = {
> +static const struct i2c_device_id sx9500_id[] __maybe_unused = {
> {"sx9500", 0},
> { },
> };
Powered by blists - more mailing lists