Skip to contentSkip to conversation

powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused

PATCH In review Mathieu Malaterre 3 participants 4 messages Mar 10, 2018 – Mar 15, 2018 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused

Re-use the object-like macro EARLYCON_USED_OR_UNUSED to mark earlycon_acpi_spcr_enable as maybe_unused.

Fix the following warning (treated as error in W=1)

CC arch/powerpc/kernel/setup-common.o
In file included from ./include/linux/serial_8250.h:14:0,
from arch/powerpc/kernel/setup-common.c:33:
./include/linux/serial_core.h:382:19: error: ‘earlycon_acpi_spcr_enable’ defined but not used [-Werror=unused-const-variable=]

 static const bool earlycon_acpi_spcr_enable;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

---
 include/linux/serial_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/serial_core.h +1 -1
index b32df49a3bd5..1d356105f25a 100644
@@ -379,7 +379,7 @@ extern int of_setup_earlycon(const struct earlycon_id *match,
 extern bool earlycon_acpi_spcr_enable __initdata;
 int setup_earlycon(char *buf);
 #else
-static const bool earlycon_acpi_spcr_enable;
+static const bool earlycon_acpi_spcr_enable EARLYCON_USED_OR_UNUSED;
 static inline int setup_earlycon(char *buf) { return 0; }
 #endif
 
Signature · 1 line
2.11.0
#1 lore raw
Quoted 1 line · Mathieu Malaterre

Subject: Re: [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused

You're fixing an error on powerpc, but the patch is to the serial code, so the subject should probably be more like:

serial: core: Mark the variable earlycon_acpi_spcr_enable maybe_unused

cheers

Quoted 33 lines

Re-use the object-like macro EARLYCON_USED_OR_UNUSED to mark earlycon_acpi_spcr_enable as maybe_unused.

Fix the following warning (treated as error in W=1)

CC arch/powerpc/kernel/setup-common.o
In file included from ./include/linux/serial_8250.h:14:0,
from arch/powerpc/kernel/setup-common.c:33:
./include/linux/serial_core.h:382:19: error: ‘earlycon_acpi_spcr_enable’ defined but not used [-Werror=unused-const-variable=]

 static const bool earlycon_acpi_spcr_enable;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

---
 include/linux/serial_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/serial_core.h +1 -1
index b32df49a3bd5..1d356105f25a 100644
@@ -379,7 +379,7 @@ extern int of_setup_earlycon(const struct earlycon_id *match,
 extern bool earlycon_acpi_spcr_enable __initdata;
 int setup_earlycon(char *buf);
 #else
-static const bool earlycon_acpi_spcr_enable;
+static const bool earlycon_acpi_spcr_enable EARLYCON_USED_OR_UNUSED;
 static inline int setup_earlycon(char *buf) { return 0; }
 #endif
 
Signature · 1 line
2.11.0
#2 lore raw
Quoted 7 lines · Michael Ellerman
Quoted 1 line · Mathieu Malaterre

Subject: Re: [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused

You're fixing an error on powerpc, but the patch is to the serial code, so the subject should probably be more like:

serial: core: Mark the variable earlycon_acpi_spcr_enable maybe_unused

Ah, right. I should have double-checked when re-sending this one.

Greg, do you want a v2 ?

Quoted 35 lines

cheers

Quoted 33 lines

Re-use the object-like macro EARLYCON_USED_OR_UNUSED to mark earlycon_acpi_spcr_enable as maybe_unused.

Fix the following warning (treated as error in W=1)

CC arch/powerpc/kernel/setup-common.o
In file included from ./include/linux/serial_8250.h:14:0,
from arch/powerpc/kernel/setup-common.c:33:
./include/linux/serial_core.h:382:19: error: ‘earlycon_acpi_spcr_enable’ defined but not used [-Werror=unused-const-variable=]

 static const bool earlycon_acpi_spcr_enable;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors

---
 include/linux/serial_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/serial_core.h +1 -2
index b32df49a3bd5..1d356105f25a 100644
@@ -379,7 +379,7 @@ extern int of_setup_earlycon(const struct earlycon_id *match,
 extern bool earlycon_acpi_spcr_enable __initdata;
 int setup_earlycon(char *buf);
 #else
-static const bool earlycon_acpi_spcr_enable;
+static const bool earlycon_acpi_spcr_enable EARLYCON_USED_OR_UNUSED;
 static inline int setup_earlycon(char *buf) { return 0; }
 #endif
 
--

2.11.0

#3 lore raw
Quoted 4 lines · Mathieu Malaterre
Quoted 3 lines · Michael Ellerman
Quoted 1 line · Mathieu Malaterre

Subject: Re: [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused

Quoted 8 lines
Quoted 4 lines

You're fixing an error on powerpc, but the patch is to the serial code, so the subject should probably be more like:

serial: core: Mark the variable earlycon_acpi_spcr_enable maybe_unused

Ah, right. I should have double-checked when re-sending this one.

Greg, do you want a v2 ?

Oops, no, already applied this, it's fine :)