[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z71waEVlSnFpYDcC@surfacebook.localdomain>
Date: Tue, 25 Feb 2025 09:25:28 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Yu-Chun Lin <eleanor15x@...il.com>
Cc: dmitry.torokhov@...il.com, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, jserv@...s.ncku.edu.tw,
visitorckw@...il.com, kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] Input: wdt87xx_i2c - fix compiler warning
Sun, Jan 19, 2025 at 04:43:12PM +0800, Yu-Chun Lin kirjoitti:
> As reported by the kernel test robot, the following warning occur:
>
> >> drivers/input/touchscreen/wdt87xx_i2c.c:1166:36: warning: 'wdt87xx_acpi_id' defined but not used [-Wunused-const-variable=]
> 1166 | static const struct acpi_device_id wdt87xx_acpi_id[] = {
> | ^~~~~~~~~~~~~~~
>
> The 'wdt87xx_acpi_id' array is only used when CONFIG_ACPI is enabled.
> Wrapping its definition and 'MODULE_DEVICE_TABLE' in '#ifdef CONFIG_ACPI'
> prevents a compiler warning when ACPI is disabled.
> +#ifdef CONFIG_ACPI
> static const struct acpi_device_id wdt87xx_acpi_id[] = {
> { "WDHT0001", 0 },
> { }
> };
> MODULE_DEVICE_TABLE(acpi, wdt87xx_acpi_id);
> +#endif
Instead, this should get rid of ugly ifdeffery and whatever that makes variable
disappear (ACPI_PTR() call?). It even possible that this make unneeded of
inclusion of some header(s).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists