All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused
@ 2018-03-10 18:06 Mathieu Malaterre
  2018-03-15  0:54 ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Malaterre @ 2018-03-10 18:06 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Michael Ellerman, Mathieu Malaterre, Jiri Slaby, linux-kernel

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

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 include/linux/serial_core.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index b32df49a3bd5..1d356105f25a 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused
  2018-03-10 18:06 [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused Mathieu Malaterre
@ 2018-03-15  0:54 ` Michael Ellerman
  2018-03-15  7:08   ` Mathieu Malaterre
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Ellerman @ 2018-03-15  0:54 UTC (permalink / raw)
  To: Mathieu Malaterre, Greg Kroah-Hartman
  Cc: Mathieu Malaterre, Jiri Slaby, linux-kernel

Mathieu Malaterre <malat@debian.org> writes:
> 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

> 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
>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
>  include/linux/serial_core.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index b32df49a3bd5..1d356105f25a 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused
  2018-03-15  0:54 ` Michael Ellerman
@ 2018-03-15  7:08   ` Mathieu Malaterre
  2018-03-15 17:28     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Malaterre @ 2018-03-15  7:08 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Greg Kroah-Hartman, Jiri Slaby, LKML

On Thu, Mar 15, 2018 at 1:54 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Mathieu Malaterre <malat@debian.org> writes:
>> 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 ?

> cheers
>
>> 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
>>
>> Signed-off-by: Mathieu Malaterre <malat@debian.org>
>> ---
>>  include/linux/serial_core.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
>> index b32df49a3bd5..1d356105f25a 100644
>> --- a/include/linux/serial_core.h
>> +++ b/include/linux/serial_core.h
>> @@ -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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused
  2018-03-15  7:08   ` Mathieu Malaterre
@ 2018-03-15 17:28     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2018-03-15 17:28 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: Michael Ellerman, Jiri Slaby, LKML

On Thu, Mar 15, 2018 at 08:08:29AM +0100, Mathieu Malaterre wrote:
> On Thu, Mar 15, 2018 at 1:54 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> > Mathieu Malaterre <malat@debian.org> writes:
> >> 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 ?

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-15 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-10 18:06 [PATCH] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused Mathieu Malaterre
2018-03-15  0:54 ` Michael Ellerman
2018-03-15  7:08   ` Mathieu Malaterre
2018-03-15 17:28     ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.