Linux Kernels

serial: fsl_lpuart: Remove unused 'bd' variable

This change “serial: fsl_lpuart: Remove unused 'bd' variable” (commit c45e2d2) in Linux kernel is authored by Fabio Estevam <fabio.estevam [at] nxp.com> on Mon Sep 18 08:33:28 2017 -0300.

Description of "serial: fsl_lpuart: Remove unused 'bd' variable"

The change “serial: fsl_lpuart: Remove unused 'bd' variable” introduces changes as follows.

serial: fsl_lpuart: Remove unused 'bd' variable

Since commit a6d7514b14a6 ("tty: serial: lpuart: add a more accurate baud
rate calculation method") the baud rate is now calculated inside the
lpuart32_serial_setbrg() function, so we no longer need to read the
UARTBAUD register inside lpuart32_set_termios().

The 'bd' variable can be simply removed.

This fixes the following build warning with W=1:

drivers/tty/serial/fsl_lpuart.c: In function 'lpuart32_set_termios':
drivers/tty/serial/fsl_lpuart.c:1652:32: warning: variable 'bd' set but not used [-Wunused-but-set-variable]

Fixes: a6d7514b14a6 ("tty: serial: lpuart: add a more accurate baud rate calculation method")
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit c45e2d2

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "serial: fsl_lpuart: Remove unused 'bd' variable"

There are 3 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/tty/serial/fsl_lpuart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
 
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 849c1f9991ce..63f99a0b533f 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1649,12 +1649,11 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
 {
 	struct lpuart_port *sport = container_of(port, struct lpuart_port, port);
 	unsigned long flags;
-	unsigned long ctrl, old_ctrl, bd, modem;
+	unsigned long ctrl, old_ctrl, modem;
 	unsigned int  baud;
 	unsigned int old_csize = old ? old->c_cflag & CSIZE : CS8;
 
 	ctrl = old_ctrl = lpuart32_read(&sport->port, UARTCTRL);
-	bd = lpuart32_read(&sport->port, UARTBAUD);
 	modem = lpuart32_read(&sport->port, UARTMODIR);
 	/*
 	 * only support CS8 and CS7, and for CS7 must enable PE.

The commit for this change in Linux stable tree is c45e2d2 (patch).

Last modified: 2020/01/11 06:46