diff mbox series

[2/2] tpm: tpm_tis_spi: Mark ACPI and OF related data as maybe unused

Message ID 20230311173541.262949-2-krzysztof.kozlowski@linaro.org (mailing list archive)
State New, archived
Headers show
Series [1/2] tpm: st33zp24: Mark ACPI and OF related data as maybe unused | expand

Commit Message

Krzysztof Kozlowski March 11, 2023, 5:35 p.m. UTC
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(-)

Comments

Jarkko Sakkinen March 12, 2023, 1:53 a.m. UTC | #1
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
Krzysztof Kozlowski March 12, 2023, 10:06 a.m. UTC | #2
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
diff mbox series

Patch

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},
 	{}
 };