Message ID | 20230810111933.205619-2-krzysztof.kozlowski@linaro.org (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [1/2] iio: dac: ad5755: mark OF related data as maybe unused | expand |
On Thu, 10 Aug 2023 13:19:33 +0200 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 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@linaro.org> > --- > 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 = {
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 = {
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. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> --- drivers/iio/proximity/isl29501.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)