All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused
@ 2023-03-11 17:35 Krzysztof Kozlowski
  2023-03-11 17:35 ` [PATCH 2/2] tpm: tpm_tis_spi: " Krzysztof Kozlowski
  2023-03-12  1:53 ` [PATCH 1/2] tpm: st33zp24: " Jarkko Sakkinen
  0 siblings, 2 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-11 17:35 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
	linux-kernel
  Cc: Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making

  drivers/char/tpm/st33zp24/i2c.c:141:34: error: ‘of_st33zp24_i2c_match’ defined but not used [-Werror=unused-const-variable=]
  drivers/char/tpm/st33zp24/spi.c:258:34: error: ‘of_st33zp24_spi_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/char/tpm/st33zp24/i2c.c | 4 ++--
 drivers/char/tpm/st33zp24/spi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
index c4d0b744e3cc..2d28f55ef490 100644
--- a/drivers/char/tpm/st33zp24/i2c.c
+++ b/drivers/char/tpm/st33zp24/i2c.c
@@ -138,13 +138,13 @@ static const struct i2c_device_id st33zp24_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);
 
-static const struct of_device_id of_st33zp24_i2c_match[] = {
+static const struct of_device_id of_st33zp24_i2c_match[] __maybe_unused = {
 	{ .compatible = "st,st33zp24-i2c", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, of_st33zp24_i2c_match);
 
-static const struct acpi_device_id st33zp24_i2c_acpi_match[] = {
+static const struct acpi_device_id st33zp24_i2c_acpi_match[] __maybe_unused = {
 	{"SMO3324"},
 	{}
 };
diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c
index 2154059f0235..f5811b301d3b 100644
--- a/drivers/char/tpm/st33zp24/spi.c
+++ b/drivers/char/tpm/st33zp24/spi.c
@@ -255,13 +255,13 @@ static const struct spi_device_id st33zp24_spi_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, st33zp24_spi_id);
 
-static const struct of_device_id of_st33zp24_spi_match[] = {
+static const struct of_device_id of_st33zp24_spi_match[] __maybe_unused = {
 	{ .compatible = "st,st33zp24-spi", },
 	{}
 };
 MODULE_DEVICE_TABLE(of, of_st33zp24_spi_match);
 
-static const struct acpi_device_id st33zp24_spi_acpi_match[] = {
+static const struct acpi_device_id st33zp24_spi_acpi_match[] __maybe_unused = {
 	{"SMO3324"},
 	{}
 };
-- 
2.34.1


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

* [PATCH 2/2] tpm: tpm_tis_spi: Mark ACPI and OF related data as maybe unused
  2023-03-11 17:35 [PATCH 1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused Krzysztof Kozlowski
@ 2023-03-11 17:35 ` Krzysztof Kozlowski
  2023-03-12  1:53   ` Jarkko Sakkinen
  2023-03-12  1:53 ` [PATCH 1/2] tpm: st33zp24: " Jarkko Sakkinen
  1 sibling, 1 reply; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-11 17:35 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
	linux-kernel
  Cc: Krzysztof Kozlowski

The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
unused:

  drivers/char/tpm/tpm_tis_spi_main.c:234:34: error: ‘of_tis_spi_match’ defined but not used [-Werror=unused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/char/tpm/tpm_tis_spi_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
index a0963a3e92bd..1f5207974a17 100644
--- a/drivers/char/tpm/tpm_tis_spi_main.c
+++ b/drivers/char/tpm/tpm_tis_spi_main.c
@@ -231,7 +231,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
 
-static const struct of_device_id of_tis_spi_match[] = {
+static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
 	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
 	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
 	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },
@@ -240,7 +240,7 @@ static const struct of_device_id of_tis_spi_match[] = {
 };
 MODULE_DEVICE_TABLE(of, of_tis_spi_match);
 
-static const struct acpi_device_id acpi_tis_spi_match[] = {
+static const struct acpi_device_id acpi_tis_spi_match[] __maybe_unused = {
 	{"SMO0768", 0},
 	{}
 };
-- 
2.34.1


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

* Re: [PATCH 1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused
  2023-03-11 17:35 [PATCH 1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused Krzysztof Kozlowski
  2023-03-11 17:35 ` [PATCH 2/2] tpm: tpm_tis_spi: " Krzysztof Kozlowski
@ 2023-03-12  1:53 ` Jarkko Sakkinen
  2023-03-12 10:06   ` Krzysztof Kozlowski
  1 sibling, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-03-12  1:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel

On Sat, Mar 11, 2023 at 06:35:40PM +0100, Krzysztof Kozlowski wrote:
> The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
> 
>   drivers/char/tpm/st33zp24/i2c.c:141:34: error: ‘of_st33zp24_i2c_match’ defined but not used [-Werror=unused-const-variable=]
>   drivers/char/tpm/st33zp24/spi.c:258:34: error: ‘of_st33zp24_spi_match’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Please also briefly describe the change.

> ---
>  drivers/char/tpm/st33zp24/i2c.c | 4 ++--
>  drivers/char/tpm/st33zp24/spi.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
> index c4d0b744e3cc..2d28f55ef490 100644
> --- a/drivers/char/tpm/st33zp24/i2c.c
> +++ b/drivers/char/tpm/st33zp24/i2c.c
> @@ -138,13 +138,13 @@ static const struct i2c_device_id st33zp24_i2c_id[] = {
>  };
>  MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);
>  
> -static const struct of_device_id of_st33zp24_i2c_match[] = {
> +static const struct of_device_id of_st33zp24_i2c_match[] __maybe_unused = {
>  	{ .compatible = "st,st33zp24-i2c", },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, of_st33zp24_i2c_match);
>  
> -static const struct acpi_device_id st33zp24_i2c_acpi_match[] = {
> +static const struct acpi_device_id st33zp24_i2c_acpi_match[] __maybe_unused = {
>  	{"SMO3324"},
>  	{}
>  };
> diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c
> index 2154059f0235..f5811b301d3b 100644
> --- a/drivers/char/tpm/st33zp24/spi.c
> +++ b/drivers/char/tpm/st33zp24/spi.c
> @@ -255,13 +255,13 @@ static const struct spi_device_id st33zp24_spi_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, st33zp24_spi_id);
>  
> -static const struct of_device_id of_st33zp24_spi_match[] = {
> +static const struct of_device_id of_st33zp24_spi_match[] __maybe_unused = {
>  	{ .compatible = "st,st33zp24-spi", },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, of_st33zp24_spi_match);
>  
> -static const struct acpi_device_id st33zp24_spi_acpi_match[] = {
> +static const struct acpi_device_id st33zp24_spi_acpi_match[] __maybe_unused = {
>  	{"SMO3324"},
>  	{}
>  };
> -- 
> 2.34.1
> 

BR, Jarkko

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

* Re: [PATCH 2/2] tpm: tpm_tis_spi: Mark ACPI and OF related data as maybe unused
  2023-03-11 17:35 ` [PATCH 2/2] tpm: tpm_tis_spi: " Krzysztof Kozlowski
@ 2023-03-12  1:53   ` Jarkko Sakkinen
  2023-03-12 10:06     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2023-03-12  1:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel

On Sat, Mar 11, 2023 at 06:35:41PM +0100, Krzysztof Kozlowski wrote:
> The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
> unused:
> 
>   drivers/char/tpm/tpm_tis_spi_main.c:234:34: error: ‘of_tis_spi_match’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/char/tpm/tpm_tis_spi_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
> index a0963a3e92bd..1f5207974a17 100644
> --- a/drivers/char/tpm/tpm_tis_spi_main.c
> +++ b/drivers/char/tpm/tpm_tis_spi_main.c
> @@ -231,7 +231,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
>  };
>  MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
>  
> -static const struct of_device_id of_tis_spi_match[] = {
> +static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
>  	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
>  	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
>  	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },
> @@ -240,7 +240,7 @@ static const struct of_device_id of_tis_spi_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, of_tis_spi_match);
>  
> -static const struct acpi_device_id acpi_tis_spi_match[] = {
> +static const struct acpi_device_id acpi_tis_spi_match[] __maybe_unused = {
>  	{"SMO0768", 0},
>  	{}
>  };
> -- 
> 2.34.1
> 

Ditto.

BR, Jarkko

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

* Re: [PATCH 1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused
  2023-03-12  1:53 ` [PATCH 1/2] tpm: st33zp24: " Jarkko Sakkinen
@ 2023-03-12 10:06   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 10:06 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel

On 12/03/2023 02:53, Jarkko Sakkinen wrote:
> On Sat, Mar 11, 2023 at 06:35:40PM +0100, Krzysztof Kozlowski wrote:
>> The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
>>
>>   drivers/char/tpm/st33zp24/i2c.c:141:34: error: ‘of_st33zp24_i2c_match’ defined but not used [-Werror=unused-const-variable=]
>>   drivers/char/tpm/st33zp24/spi.c:258:34: error: ‘of_st33zp24_spi_match’ defined but not used [-Werror=unused-const-variable=]
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> Please also briefly describe the change.

I lost there piece of word. Should be:

"The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
unused."

This is self-descriptive, I think. We allow it to be unused. Solution is
trivial and so common, I am really not sure what's the benefit to repeat
the code in the commit msg 100 times... The code is really obvious, thus
the commit msg focuses on the "why".

> 
>> ---
>>  drivers/char/tpm/st33zp24/i2c.c | 4 ++--
>>  drivers/char/tpm/st33zp24/spi.c | 4 ++--
>>  2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/char/tpm/st33zp24/i2c.c b/drivers/char/tpm/st33zp24/i2c.c
>> index c4d0b744e3cc..2d28f55ef490 100644
>> --- a/drivers/char/tpm/st33zp24/i2c.c
>> +++ b/drivers/char/tpm/st33zp24/i2c.c
>> @@ -138,13 +138,13 @@ static const struct i2c_device_id st33zp24_i2c_id[] = {
>>  };
>>  MODULE_DEVICE_TABLE(i2c, st33zp24_i2c_id);
>>  
>> -static const struct of_device_id of_st33zp24_i2c_match[] = {
>> +static const struct of_device_id of_st33zp24_i2c_match[] __maybe_unused = {
>>  	{ .compatible = "st,st33zp24-i2c", },
>>  	{}
>>  };
>>  MODULE_DEVICE_TABLE(of, of_st33zp24_i2c_match);
>>  
>> -static const struct acpi_device_id st33zp24_i2c_acpi_match[] = {
>> +static const struct acpi_device_id st33zp24_i2c_acpi_match[] __maybe_unused = {
>>  	{"SMO3324"},
>>  	{}

Best regards,
Krzysztof


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

* Re: [PATCH 2/2] tpm: tpm_tis_spi: Mark ACPI and OF related data as maybe unused
  2023-03-12  1:53   ` Jarkko Sakkinen
@ 2023-03-12 10:06     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-12 10:06 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Peter Huewe, Jason Gunthorpe, linux-integrity, linux-kernel

On 12/03/2023 02:53, Jarkko Sakkinen wrote:
> On Sat, Mar 11, 2023 at 06:35:41PM +0100, Krzysztof Kozlowski wrote:
>> The driver can be compile tested with !CONFIG_OF or !CONFIG_ACPI making
>> unused:
>>
>>   drivers/char/tpm/tpm_tis_spi_main.c:234:34: error: ‘of_tis_spi_match’ defined but not used [-Werror=unused-const-variable=]
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> ---
>>  drivers/char/tpm/tpm_tis_spi_main.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
>> index a0963a3e92bd..1f5207974a17 100644
>> --- a/drivers/char/tpm/tpm_tis_spi_main.c
>> +++ b/drivers/char/tpm/tpm_tis_spi_main.c
>> @@ -231,7 +231,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
>>  };
>>  MODULE_DEVICE_TABLE(spi, tpm_tis_spi_id);
>>  
>> -static const struct of_device_id of_tis_spi_match[] = {
>> +static const struct of_device_id of_tis_spi_match[] __maybe_unused = {
>>  	{ .compatible = "st,st33htpm-spi", .data = tpm_tis_spi_probe },
>>  	{ .compatible = "infineon,slb9670", .data = tpm_tis_spi_probe },
>>  	{ .compatible = "tcg,tpm_tis-spi", .data = tpm_tis_spi_probe },
>> @@ -240,7 +240,7 @@ static const struct of_device_id of_tis_spi_match[] = {
>>  };
>>  MODULE_DEVICE_TABLE(of, of_tis_spi_match);
>>  
>> -static const struct acpi_device_id acpi_tis_spi_match[] = {
>> +static const struct acpi_device_id acpi_tis_spi_match[] __maybe_unused = {
>>  	{"SMO0768", 0},
>>  	{}
>>  };
>> -- 
>> 2.34.1
>>
> 
> Ditto.

This commit msg was not cut, so what do you want to describe here? It's
obvious and there is no single point to repeat code in commit msg. What
the commit does is easily visible from the diff.

Best regards,
Krzysztof


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

end of thread, other threads:[~2023-03-12 10:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-11 17:35 [PATCH 1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused Krzysztof Kozlowski
2023-03-11 17:35 ` [PATCH 2/2] tpm: tpm_tis_spi: " Krzysztof Kozlowski
2023-03-12  1:53   ` Jarkko Sakkinen
2023-03-12 10:06     ` Krzysztof Kozlowski
2023-03-12  1:53 ` [PATCH 1/2] tpm: st33zp24: " Jarkko Sakkinen
2023-03-12 10:06   ` Krzysztof Kozlowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.