diff mbox series

serial: sunzilog: Mark sunzilog_putchar() __maybe_unused

Message ID 20211026080426.2444756-1-geert@linux-m68k.org
State New
Headers show
Series serial: sunzilog: Mark sunzilog_putchar() __maybe_unused | expand

Commit Message

Geert Uytterhoeven Oct. 26, 2021, 8:04 a.m. UTC
If CONSOLE_POLL=n, CONFIG_SERIAL_SUNZILOG_CONSOLE=n, and CONFIG_SERIO=m:

    drivers/tty/serial/sunzilog.c:1128:13: error: ‘sunzilog_putchar’ defined but not used [-Werror=unused-function]
     1128 | static void sunzilog_putchar(struct uart_port *port, int ch)
	  |             ^~~~~~~~~~~~~~~~

Fix this by marking sunzilog_putchar() __maybe_unused.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
One more casualty of CONFIG_WERROR=y.
---
 drivers/tty/serial/sunzilog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Oct. 26, 2021, 8:14 a.m. UTC | #1
On Tue, Oct 26, 2021 at 10:04 AM Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>
> If CONSOLE_POLL=n, CONFIG_SERIAL_SUNZILOG_CONSOLE=n, and CONFIG_SERIO=m:
>
>     drivers/tty/serial/sunzilog.c:1128:13: error: ‘sunzilog_putchar’ defined but not used [-Werror=unused-function]
>      1128 | static void sunzilog_putchar(struct uart_port *port, int ch)
>           |             ^~~~~~~~~~~~~~~~
>
> Fix this by marking sunzilog_putchar() __maybe_unused.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Looks good to me

Acked-by: Arnd Bergmann <arnd@arndb.de>
David Miller Oct. 26, 2021, 12:32 p.m. UTC | #2
From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Tue, 26 Oct 2021 10:04:26 +0200

> If CONSOLE_POLL=n, CONFIG_SERIAL_SUNZILOG_CONSOLE=n, and CONFIG_SERIO=m:
> 
>     drivers/tty/serial/sunzilog.c:1128:13: error: ‘sunzilog_putchar’ defined but not used [-Werror=unused-function]
>      1128 | static void sunzilog_putchar(struct uart_port *port, int ch)
> 	  |             ^~~~~~~~~~~~~~~~
> 
> Fix this by marking sunzilog_putchar() __maybe_unused.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: David S. Miller <davem@davemloft.net>
diff mbox series

Patch

diff --git a/drivers/tty/serial/sunzilog.c b/drivers/tty/serial/sunzilog.c
index 1a54e3e52ed630b6..b714b00d2dadd44f 100644
--- a/drivers/tty/serial/sunzilog.c
+++ b/drivers/tty/serial/sunzilog.c
@@ -1125,7 +1125,7 @@  static void sunzilog_free_tables(void)
 
 #define ZS_PUT_CHAR_MAX_DELAY	2000	/* 10 ms */
 
-static void sunzilog_putchar(struct uart_port *port, int ch)
+static void __maybe_unused sunzilog_putchar(struct uart_port *port, int ch)
 {
 	struct zilog_channel __iomem *channel = ZILOG_CHANNEL_FROM_PORT(port);
 	int loops = ZS_PUT_CHAR_MAX_DELAY;