Skip to contentSkip to conversation

serial/arc: Fix warning with CONSOLE_POLL

PATCH In review Vineet Gupta 2 participants 3 messages Jul 11, 2014 – Jul 12, 2014 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 53bf1d9a.l51qTAII/GCO14wJ%[email protected]

#1 lore raw

PATCH 1/1 serial/arc: Fix warning with CONSOLE_POLL

| drivers/tty/serial/arc_uart.c:516:2: warning: (near initialization for 'arc_serial_pops.poll_put_char') [enabled by default]

This partially undoes "serial/arc: use uart_console_write() helper" by restoring the prototpye of poll helper and use a different one in uart_console_write()

---
 drivers/tty/serial/arc_uart.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
drivers/tty/serial/arc_uart.c +13 -7
index d9900cb3e7b6..750638fc8a4a 100644
@@ -449,18 +449,16 @@ static void arc_serial_config_port(struct uart_port *port, int flags)
 		port->type = PORT_ARC;
 }
 
-#if defined(CONFIG_CONSOLE_POLL) || defined(CONFIG_SERIAL_ARC_CONSOLE)
+#ifdef CONFIG_CONSOLE_POLL
 
-static void arc_serial_poll_putchar(struct uart_port *port, int chr)
+static void arc_serial_poll_putchar(struct uart_port *port, unsigned char chr)
 {
 	while (!(UART_GET_STATUS(port) & TXEMPTY))
 		cpu_relax();
 
-	UART_SET_DATA(port, (unsigned char)chr);
+	UART_SET_DATA(port, chr);
 }
-#endif
 
-#ifdef CONFIG_CONSOLE_POLL
 static int arc_serial_poll_getchar(struct uart_port *port)
 {
 	unsigned char chr;
@@ -527,6 +525,14 @@ static int arc_serial_console_setup(struct console *co, char *options)
 	return uart_set_options(port, co, baud, parity, bits, flow);
 }
 
+static void arc_serial_console_putchar(struct uart_port *port, int ch)
+{
+	while (!(UART_GET_STATUS(port) & TXEMPTY))
+		cpu_relax();
+
+	UART_SET_DATA(port, (unsigned char)ch);
+}
+
 /*
  * Interrupts are disabled on entering
  */
@@ -537,7 +543,7 @@ static void arc_serial_console_write(struct console *co, const char *s,
 	unsigned long flags;
 
 	spin_lock_irqsave(&port->lock, flags);
-	uart_console_write(port, s, count, arc_serial_poll_putchar);
+	uart_console_write(port, s, count, arc_serial_console_putchar);
 	spin_unlock_irqrestore(&port->lock, flags);
 }
 
@@ -556,7 +562,7 @@ static __init void arc_early_serial_write(struct console *con, const char *s,
 {
 	struct earlycon_device *dev = con->data;
 
-	uart_console_write(&dev->port, s, n, arc_serial_poll_putchar);
+	uart_console_write(&dev->port, s, n, arc_serial_console_putchar);
 }
 
 static int __init arc_early_console_setup(struct earlycon_device *dev,
Signature · 1 line
1.8.3.2
maintainer
#2 lore raw
Quoted 7 lines · Vineet Gupta

| drivers/tty/serial/arc_uart.c:516:2: warning: (near initialization for 'arc_serial_pops.poll_put_char') [enabled by default]

This partially undoes "serial/arc: use uart_console_write() helper" by restoring the prototpye of poll helper and use a different one in uart_console_write()

You forgot a "Reported-by:" line here.

I'll go add it...

#3 lore raw
Quoted 11 lines · Greg KH
Quoted 7 lines · Vineet Gupta

| drivers/tty/serial/arc_uart.c:516:2: warning: (near initialization for 'arc_serial_pops.poll_put_char') [enabled by default]

This partially undoes "serial/arc: use uart_console_write() helper" by restoring the prototpye of poll helper and use a different one in uart_console_write()

You forgot a "Reported-by:" line here.

I'll go add it...

Sorry my bad - thx for taking care of this.

-Vineet