Skip to contentSkip to conversation

serial: sunzilog: Mark sunzilog_putchar() __maybe_unused

PATCH In review Geert Uytterhoeven 3 participants 3 messages Oct 26, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: sunzilog: Mark sunzilog_putchar() __maybe_unused

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.

---
One more casualty of CONFIG_WERROR=y.

---
 drivers/tty/serial/sunzilog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sunzilog.c +1 -1
index 1a54e3e52ed630b6..b714b00d2dadd44f 100644
@@ -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;
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Geert Uytterhoeven

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.

Looks good to me

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Geert Uytterhoeven

From: Geert Uytterhoeven <[email protected]>
Date: Tue, 26 Oct 2021 10:04:26 +0200

Quoted 9 lines

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.