diff mbox series

[09/10] gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use

Message ID 20200630133345.2232932-10-lee.jones@linaro.org (mailing list archive)
State Mainlined
Commit 2f9bce5f38684cd10533ac41d8dd395a611cc8c5
Headers show
Series Clean GPIO of W=1 warnings | expand

Commit Message

Lee Jones June 30, 2020, 1:33 p.m. UTC
... as is the case when !CONFIG_ACPI.

Fixes the following W=1 kernel build warning:

 drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
 312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
 | ^~~~~~~~~~~~~~~~~~~~~~

Cc: Asmaa Mnebhi <Asmaa@mellanox.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/gpio/gpio-mlxbf2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Asmaa Mnebhi June 30, 2020, 2:17 p.m. UTC | #1
Reviewed-by: Asmaa Mnebhi <asmaa@mellanox.com>

Thank you.

-----Original Message-----
From: Lee Jones <lee.jones@linaro.org> 
Sent: Tuesday, June 30, 2020 9:34 AM
To: linus.walleij@linaro.org; bgolaszewski@baylibre.com
Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; linux-gpio@vger.kernel.org; Lee Jones <lee.jones@linaro.org>; Asmaa Mnebhi <Asmaa@mellanox.com>
Subject: [PATCH 09/10] gpio: gpio-mlxbf2: Tell the compiler that ACPI functions may not be use

... as is the case when !CONFIG_ACPI.

Fixes the following W=1 kernel build warning:

 drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
 312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {  | ^~~~~~~~~~~~~~~~~~~~~~

Cc: Asmaa Mnebhi <Asmaa@mellanox.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/gpio/gpio-mlxbf2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c index 94d5efce1721c..861a8d0a84be0 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -309,7 +309,7 @@ static int mlxbf2_gpio_resume(struct platform_device *pdev)  }  #endif
 
-static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
+static const struct acpi_device_id __maybe_unused 
+mlxbf2_gpio_acpi_match[] = {
 	{ "MLNXBF22", 0 },
 	{},
 };
--
2.25.1
Linus Walleij July 8, 2020, 7:22 a.m. UTC | #2
On Tue, Jun 30, 2020 at 3:33 PM Lee Jones <lee.jones@linaro.org> wrote:

> ... as is the case when !CONFIG_ACPI.
>
> Fixes the following W=1 kernel build warning:
>
>  drivers/gpio/gpio-mlxbf2.c:312:36: warning: ‘mlxbf2_gpio_acpi_match’ defined but not used [-Wunused-const-variable=]
>  312 | static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
>  | ^~~~~~~~~~~~~~~~~~~~~~
>
> Cc: Asmaa Mnebhi <Asmaa@mellanox.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>

Patch applied!

Yours,
Linus Walleij
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index 94d5efce1721c..861a8d0a84be0 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -309,7 +309,7 @@  static int mlxbf2_gpio_resume(struct platform_device *pdev)
 }
 #endif
 
-static const struct acpi_device_id mlxbf2_gpio_acpi_match[] = {
+static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[] = {
 	{ "MLNXBF22", 0 },
 	{},
 };