Skip to contentSkip to conversation

serial: sunplus-uart: change sunplus_console_ports from global to static

PATCH In review Tom Rix 2 participants 2 messages Apr 21, 2022 – Apr 22, 2022

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 serial: sunplus-uart: change sunplus_console_ports from global to static

Smatch reports this issue
sunplus-uart.c:501:26: warning: symbol 'sunplus_console_ports' was not declared. Should it be static?

sunplus_console_ports is only used in sunplus-uart.c so change its storage-class specifier to static

---
 drivers/tty/serial/sunplus-uart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sunplus-uart.c +1 -1
index 9f15922e681b..60c73662f955 100644
@@ -498,7 +498,7 @@ static const struct uart_ops sunplus_uart_ops = {
 };
 
 #ifdef CONFIG_SERIAL_SUNPLUS_CONSOLE
-struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR];
+static struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR];
 
 static void sunplus_uart_console_putchar(struct uart_port *port,
 					 unsigned char ch)
Signature · 1 line
2.27.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Tom Rix

Smatch reports this issue
sunplus-uart.c:501:26: warning: symbol 'sunplus_console_ports' was not declared. Should it be static?

sunplus_console_ports is only used in sunplus-uart.c so change its storage-class specifier to static

Heh, coincidentally, I've sent the same fix yesterday too:
https://lore.kernel.org/all/[email protected]/

Greg, whichever you take:

Quoted 18 lines
---
  drivers/tty/serial/sunplus-uart.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sunplus-uart.c +1 -1
index 9f15922e681b..60c73662f955 100644
@@ -498,7 +498,7 @@ static const struct uart_ops sunplus_uart_ops = {
  };
 
  #ifdef CONFIG_SERIAL_SUNPLUS_CONSOLE
-struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR];
+static struct sunplus_uart_port *sunplus_console_ports[SUP_UART_NR];
 
  static void sunplus_uart_console_putchar(struct uart_port *port,
  					 unsigned char ch)
Signature · 2 lines
js
suse labs