Re: [PATCH 2/2] iio: proximity: isl29501: mark OF related data as maybe unused

From: Jonathan Cameron
Date: Fri Aug 11 2023 - 11:34:27 EST


On Thu, 10 Aug 2023 13:19:33 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx> wrote:

> When compile tested with W=1 on x86_64 with driver as built-in:
>
> isl29501.c:999:34: error: unused variable 'isl29501_i2c_matches' [-Werror,-Wunused-const-variable]
>
> The if defined(CONFIG_OF) is also not needed in such case.
As in patch 1 I'd rather see it used. Not even an match data to make that more complex
here.

>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
> ---
> drivers/iio/proximity/isl29501.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/iio/proximity/isl29501.c b/drivers/iio/proximity/isl29501.c
> index bcebacaf3dab..9e34224b5775 100644
> --- a/drivers/iio/proximity/isl29501.c
> +++ b/drivers/iio/proximity/isl29501.c
> @@ -995,13 +995,11 @@ static const struct i2c_device_id isl29501_id[] = {
>
> MODULE_DEVICE_TABLE(i2c, isl29501_id);
>
> -#if defined(CONFIG_OF)
> -static const struct of_device_id isl29501_i2c_matches[] = {
> +static const struct of_device_id isl29501_i2c_matches[] __maybe_unused = {
> { .compatible = "renesas,isl29501" },
> { }
> };
> MODULE_DEVICE_TABLE(of, isl29501_i2c_matches);
> -#endif
>
> static struct i2c_driver isl29501_driver = {
> .driver = {