2020-09-11 16:34:03

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI

Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
struct acpi_device_id becomes unused:

drivers/power/supply/bq24257_charger.c:1155:36: warning:
'bq24257_acpi_match' defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/power/supply/bq24257_charger.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
index 8e60cb0f3c3f..96cb3290bcaa 100644
--- a/drivers/power/supply/bq24257_charger.c
+++ b/drivers/power/supply/bq24257_charger.c
@@ -1152,6 +1152,7 @@ static const struct of_device_id bq24257_of_match[] = {
};
MODULE_DEVICE_TABLE(of, bq24257_of_match);

+#ifdef CONFIG_ACPI
static const struct acpi_device_id bq24257_acpi_match[] = {
{ "BQ242500", BQ24250 },
{ "BQ242510", BQ24251 },
@@ -1159,6 +1160,7 @@ static const struct acpi_device_id bq24257_acpi_match[] = {
{},
};
MODULE_DEVICE_TABLE(acpi, bq24257_acpi_match);
+#endif

static struct i2c_driver bq24257_driver = {
.driver = {
--
2.17.1


2020-10-03 20:31:29

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI

Hi,

Thanks for the cleanup, I queued all 7 patches.

-- Sebastian

On Fri, Sep 11, 2020 at 06:27:23PM +0200, Krzysztof Kozlowski wrote:
> Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
> struct acpi_device_id becomes unused:
>
> drivers/power/supply/bq24257_charger.c:1155:36: warning:
> 'bq24257_acpi_match' defined but not used [-Wunused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> drivers/power/supply/bq24257_charger.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
> index 8e60cb0f3c3f..96cb3290bcaa 100644
> --- a/drivers/power/supply/bq24257_charger.c
> +++ b/drivers/power/supply/bq24257_charger.c
> @@ -1152,6 +1152,7 @@ static const struct of_device_id bq24257_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, bq24257_of_match);
>
> +#ifdef CONFIG_ACPI
> static const struct acpi_device_id bq24257_acpi_match[] = {
> { "BQ242500", BQ24250 },
> { "BQ242510", BQ24251 },
> @@ -1159,6 +1160,7 @@ static const struct acpi_device_id bq24257_acpi_match[] = {
> {},
> };
> MODULE_DEVICE_TABLE(acpi, bq24257_acpi_match);
> +#endif
>
> static struct i2c_driver bq24257_driver = {
> .driver = {


Attachments:
(No filename) (1.28 kB)
signature.asc (849.00 B)
Download all attachments