public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused
@ 2023-08-10 11:19 Krzysztof Kozlowski
  2023-08-10 11:19 ` [PATCH 2/2] iio: proximity: isl29501: " Krzysztof Kozlowski
  2023-08-11 15:33 ` [PATCH 1/2] iio: dac: ad5755: " Jonathan Cameron
  0 siblings, 2 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10 11:19 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	linux-iio, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

When compile tested with W=1 on x86_64 with driver as built-in:

  ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/iio/dac/ad5755.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
index 404865e35460..823049ce2686 100644
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -863,7 +863,7 @@ static const struct spi_device_id ad5755_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad5755_id);
 
-static const struct of_device_id ad5755_of_match[] = {
+static const struct of_device_id ad5755_of_match[] __maybe_unused = {
 	{ .compatible = "adi,ad5755" },
 	{ .compatible = "adi,ad5755-1" },
 	{ .compatible = "adi,ad5757" },
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] iio: proximity: isl29501: mark OF related data as maybe unused
  2023-08-10 11:19 [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused Krzysztof Kozlowski
@ 2023-08-10 11:19 ` Krzysztof Kozlowski
  2023-08-11 15:34   ` Jonathan Cameron
  2023-08-11 15:33 ` [PATCH 1/2] iio: dac: ad5755: " Jonathan Cameron
  1 sibling, 1 reply; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-10 11:19 UTC (permalink / raw)
  To: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	linux-iio, linux-kernel
  Cc: Andi Shyti, Krzysztof Kozlowski

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(-)

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 = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused
  2023-08-10 11:19 [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused Krzysztof Kozlowski
  2023-08-10 11:19 ` [PATCH 2/2] iio: proximity: isl29501: " Krzysztof Kozlowski
@ 2023-08-11 15:33 ` Jonathan Cameron
  2023-08-15 14:04   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 5+ messages in thread
From: Jonathan Cameron @ 2023-08-11 15:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	linux-iio, linux-kernel, Andi Shyti

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

> When compile tested with W=1 on x86_64 with driver as built-in:
> 
>   ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

I'd rather see the table used as relying on the fallback path via the spi_match_id table
is fragile as two tables may not have equivalent entries in the long run.
Entry missing in the spi_driver.driver structure.

Bonus points for adding the match data to the of table and making them all pointers
there and in spi_device_id table + using spi_get_device_match_data()

Jonathan


> ---
>  drivers/iio/dac/ad5755.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
> index 404865e35460..823049ce2686 100644
> --- a/drivers/iio/dac/ad5755.c
> +++ b/drivers/iio/dac/ad5755.c
> @@ -863,7 +863,7 @@ static const struct spi_device_id ad5755_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, ad5755_id);
>  
> -static const struct of_device_id ad5755_of_match[] = {
> +static const struct of_device_id ad5755_of_match[] __maybe_unused = {
>  	{ .compatible = "adi,ad5755" },
>  	{ .compatible = "adi,ad5755-1" },
>  	{ .compatible = "adi,ad5757" },


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] iio: proximity: isl29501: mark OF related data as maybe unused
  2023-08-10 11:19 ` [PATCH 2/2] iio: proximity: isl29501: " Krzysztof Kozlowski
@ 2023-08-11 15:34   ` Jonathan Cameron
  0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2023-08-11 15:34 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	linux-iio, linux-kernel, Andi Shyti

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 = {


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused
  2023-08-11 15:33 ` [PATCH 1/2] iio: dac: ad5755: " Jonathan Cameron
@ 2023-08-15 14:04   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-08-15 14:04 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lars-Peter Clausen, Michael Hennerich, Jonathan Cameron,
	linux-iio, linux-kernel, Andi Shyti

On 11/08/2023 17:33, Jonathan Cameron wrote:
> On Thu, 10 Aug 2023 13:19:32 +0200
> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> 
>> When compile tested with W=1 on x86_64 with driver as built-in:
>>
>>   ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable]
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> I'd rather see the table used as relying on the fallback path via the spi_match_id table
> is fragile as two tables may not have equivalent entries in the long run.
> Entry missing in the spi_driver.driver structure.
> 
> Bonus points for adding the match data to the of table and making them all pointers
> there and in spi_device_id table + using spi_get_device_match_data()

... and now I remember that I already sent such patch some time ago and
you already said this to me. Uh, sorry for sending the same thing again.
I'll fix it in spare time as you described.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-15 14:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10 11:19 [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused Krzysztof Kozlowski
2023-08-10 11:19 ` [PATCH 2/2] iio: proximity: isl29501: " Krzysztof Kozlowski
2023-08-11 15:34   ` Jonathan Cameron
2023-08-11 15:33 ` [PATCH 1/2] iio: dac: ad5755: " Jonathan Cameron
2023-08-15 14:04   ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox