Skip to contentSkip to conversation

tty: serial: fsl_lpuart: remove the count initialization as it is not needed

PATCH In review Sherry Sun 2 participants 2 messages Apr 18, 2022 – Apr 19, 2022 TTY layer and serial drivers

lore
Share & tools
lore

Sherry Sun

author
#0 lore raw

PATCH 1/1 tty: serial: fsl_lpuart: remove the count initialization as it is not needed

No need to initialize the count variable in lpuart_copy_rx_to_tty(), so let's remove it here.

---
 drivers/tty/serial/fsl_lpuart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/fsl_lpuart.c +1 -1
index 87789872f400..452a015825ba 100644
@@ -1118,7 +1118,7 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport)
 	struct dma_chan *chan = sport->dma_rx_chan;
 	struct circ_buf *ring = &sport->rx_ring;
 	unsigned long flags;
-	int count = 0, copied;
+	int count, copied;
 
 	if (lpuart_is_32(sport)) {
 		unsigned long sr = lpuart32_read(&sport->port, UARTSTAT);
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Sherry Sun

No need to initialize the count variable in lpuart_copy_rx_to_tty(), so let's remove it here.

Right,

Quoted 18 lines
---
  drivers/tty/serial/fsl_lpuart.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/fsl_lpuart.c +1 -1
index 87789872f400..452a015825ba 100644
@@ -1118,7 +1118,7 @@ static void lpuart_copy_rx_to_tty(struct lpuart_port *sport)
  	struct dma_chan *chan = sport->dma_rx_chan;
  	struct circ_buf *ring = &sport->rx_ring;
  	unsigned long flags;
-	int count = 0, copied;
+	int count, copied;
 
  	if (lpuart_is_32(sport)) {
  		unsigned long sr = lpuart32_read(&sport->port, UARTSTAT);
Signature · 2 lines
js
suse labs