[PATCH 03/34] platform: goldfish: remove ACPI_PTR() annotations

Arnd Bergmann posted 34 patches 1 year, 10 months ago
[PATCH 03/34] platform: goldfish: remove ACPI_PTR() annotations
Posted by Arnd Bergmann 1 year, 10 months ago
From: Arnd Bergmann <arnd@arndb.de>

On platforms without ACPI support, this causes a W=1 warning from gcc when
the driver is built-in:

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[] = {
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~

There is no real harm in just keeping the small table around, so rather
than adding more #ifdef checks, just reference it unconditionally to avoid
the warning.

Fixes: d62f324b0ac8 ("goldfish: Enable ACPI-based enumeration for android pipe")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/platform/goldfish/goldfish_pipe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index 061aa9647c19..6a0a42887857 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -940,7 +940,7 @@ static struct platform_driver goldfish_pipe_driver = {
 	.driver = {
 		.name = "goldfish_pipe",
 		.of_match_table = goldfish_pipe_of_match,
-		.acpi_match_table = ACPI_PTR(goldfish_pipe_acpi_match),
+		.acpi_match_table = goldfish_pipe_acpi_match,
 	}
 };
 
-- 
2.39.2
Re: [PATCH 03/34] platform: goldfish: remove ACPI_PTR() annotations
Posted by Andy Shevchenko 1 year, 10 months ago
On Wed, Apr 03, 2024 at 10:06:21AM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> On platforms without ACPI support, this causes a W=1 warning from gcc when
> the driver is built-in:
> 
> 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[] = {
>       |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
> 
> There is no real harm in just keeping the small table around, so rather
> than adding more #ifdef checks, just reference it unconditionally to avoid
> the warning.

With this change you also may replace acpi.h by mod_devicetable.h. Please, also
check all other conversions that you may replace of*.h/acpi.h by a proper one,
i.e. mod_devicetable.h.

When addressed, this one
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko