All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match'
@ 2024-10-25  7:41 Zeng Heng
  2024-10-25 14:27 ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Zeng Heng @ 2024-10-25  7:41 UTC (permalink / raw)
  To: jia-cheng.hu, gregkh, quic_jjohnson, u.kleine-koenig, jinqian,
	alan
  Cc: linux-kernel, bobo.shaobowang

Fix the following compilation warning:

drivers/platform/goldfish/goldfish_pipe.c:925:36: warning:
‘goldfish_pipe_acpi_match’ defined but not used
[-Wunused-const-variable=]
  925 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {

Only define the const variable when the CONFIG_ACPI is enabled.

Fixes: d62f324b0ac8 ("goldfish: Enable ACPI-based enumeration for android pipe")
Signed-off-by: Zeng Heng <zengheng4@huawei.com>
---
 drivers/platform/goldfish/goldfish_pipe.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index c2aab0cfab33..aeabacba3760 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -922,11 +922,13 @@ static void goldfish_pipe_remove(struct platform_device *pdev)
 	goldfish_pipe_device_deinit(pdev, dev);
 }
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
 	{ "GFSH0003", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, goldfish_pipe_acpi_match);
+#endif
 
 static const struct of_device_id goldfish_pipe_of_match[] = {
 	{ .compatible = "google,android-pipe", },
-- 
2.25.1


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

* Re: [PATCH] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match'
  2024-10-25  7:41 [PATCH] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match' Zeng Heng
@ 2024-10-25 14:27 ` Uwe Kleine-König
  2024-10-25 14:32   ` Andy Shevchenko
  2024-10-26  1:28   ` Zeng Heng
  0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2024-10-25 14:27 UTC (permalink / raw)
  To: Zeng Heng
  Cc: jia-cheng.hu, gregkh, quic_jjohnson, jinqian, alan, linux-kernel,
	bobo.shaobowang, Andy Shevchenko

[-- Attachment #1: Type: text/plain, Size: 1615 bytes --]

Hello,

[Cc += Andy]

On Fri, Oct 25, 2024 at 03:41:29PM +0800, Zeng Heng wrote:
> Fix the following compilation warning:
> 
> drivers/platform/goldfish/goldfish_pipe.c:925:36: warning:
> ‘goldfish_pipe_acpi_match’ defined but not used
> [-Wunused-const-variable=]
>   925 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
> 
> Only define the const variable when the CONFIG_ACPI is enabled.

Note you also need CONFIG_MODULE=n to reproduce.

> Fixes: d62f324b0ac8 ("goldfish: Enable ACPI-based enumeration for android pipe")
> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
> ---
>  drivers/platform/goldfish/goldfish_pipe.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
> index c2aab0cfab33..aeabacba3760 100644
> --- a/drivers/platform/goldfish/goldfish_pipe.c
> +++ b/drivers/platform/goldfish/goldfish_pipe.c
> @@ -922,11 +922,13 @@ static void goldfish_pipe_remove(struct platform_device *pdev)
>  	goldfish_pipe_device_deinit(pdev, dev);
>  }
>  
> +#ifdef CONFIG_ACPI
>  static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
>  	{ "GFSH0003", 0 },
>  	{ },
>  };
>  MODULE_DEVICE_TABLE(acpi, goldfish_pipe_acpi_match);
> +#endif
>  
>  static const struct of_device_id goldfish_pipe_of_match[] = {
>  	{ .compatible = "google,android-pipe", },

Looking at changes like
https://lore.kernel.org/all/20241024130424.3818291-11-andriy.shevchenko@linux.intel.com/
I suggest to drop the use of ACPI_PTR() instead.

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match'
  2024-10-25 14:27 ` Uwe Kleine-König
@ 2024-10-25 14:32   ` Andy Shevchenko
  2024-10-26  1:28   ` Zeng Heng
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2024-10-25 14:32 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Zeng Heng, jia-cheng.hu, gregkh, quic_jjohnson, jinqian, alan,
	linux-kernel, bobo.shaobowang

On Fri, Oct 25, 2024 at 04:27:07PM +0200, Uwe Kleine-König wrote:
> On Fri, Oct 25, 2024 at 03:41:29PM +0800, Zeng Heng wrote:
> > Fix the following compilation warning:
> > 
> > drivers/platform/goldfish/goldfish_pipe.c:925:36: warning:
> > ‘goldfish_pipe_acpi_match’ defined but not used
> > [-Wunused-const-variable=]
> >   925 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
> > 
> > Only define the const variable when the CONFIG_ACPI is enabled.

...

> Looking at changes like
> https://lore.kernel.org/all/20241024130424.3818291-11-andriy.shevchenko@linux.intel.com/
> I suggest to drop the use of ACPI_PTR() instead.

Right, please drop ACPI_PTR() and if needed, replace acpi.h with proper
mod_devicetable.h. You may find tons of examples in IIO:
`git log --grep ACPI_PTR -- drivers/iio`.

P.S. Thanks for Cc'ing me!

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match'
  2024-10-25 14:27 ` Uwe Kleine-König
  2024-10-25 14:32   ` Andy Shevchenko
@ 2024-10-26  1:28   ` Zeng Heng
  1 sibling, 0 replies; 4+ messages in thread
From: Zeng Heng @ 2024-10-26  1:28 UTC (permalink / raw)
  To: Uwe Kleine-König, Andy Shevchenko
  Cc: jia-cheng.hu, gregkh, quic_jjohnson, jinqian, alan, linux-kernel,
	bobo.shaobowang


On 2024/10/25 22:27, Uwe Kleine-König wrote:
> Hello,
>
> [Cc += Andy]

I would loop in the next version.


>
> On Fri, Oct 25, 2024 at 03:41:29PM +0800, Zeng Heng wrote:
>> Fix the following compilation warning:
>>
>> drivers/platform/goldfish/goldfish_pipe.c:925:36: warning:
>> ‘goldfish_pipe_acpi_match’ defined but not used
>> [-Wunused-const-variable=]
>>    925 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
>>
>> Only define the const variable when the CONFIG_ACPI is enabled.
> Note you also need CONFIG_MODULE=n to reproduce.
>
>> Fixes: d62f324b0ac8 ("goldfish: Enable ACPI-based enumeration for android pipe")
>> Signed-off-by: Zeng Heng <zengheng4@huawei.com>
>> ---
>>   drivers/platform/goldfish/goldfish_pipe.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
>> index c2aab0cfab33..aeabacba3760 100644
>> --- a/drivers/platform/goldfish/goldfish_pipe.c
>> +++ b/drivers/platform/goldfish/goldfish_pipe.c
>> @@ -922,11 +922,13 @@ static void goldfish_pipe_remove(struct platform_device *pdev)
>>   	goldfish_pipe_device_deinit(pdev, dev);
>>   }
>>   
>> +#ifdef CONFIG_ACPI
>>   static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
>>   	{ "GFSH0003", 0 },
>>   	{ },
>>   };
>>   MODULE_DEVICE_TABLE(acpi, goldfish_pipe_acpi_match);
>> +#endif
>>   
>>   static const struct of_device_id goldfish_pipe_of_match[] = {
>>   	{ .compatible = "google,android-pipe", },
> Looking at changes like
> https://lore.kernel.org/all/20241024130424.3818291-11-andriy.shevchenko@linux.intel.com/
> I suggest to drop the use of ACPI_PTR() instead.

Right, got it.


Best regards,

Zeng Heng




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

end of thread, other threads:[~2024-10-26  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-25  7:41 [PATCH] goldfish: Fix unused const variable 'goldfish_pipe_acpi_match' Zeng Heng
2024-10-25 14:27 ` Uwe Kleine-König
2024-10-25 14:32   ` Andy Shevchenko
2024-10-26  1:28   ` Zeng Heng

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.