[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200214161147.15842-84-sashal@kernel.org>
Date: Fri, 14 Feb 2020 11:08:59 -0500
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Xiongfeng Wang <wangxiongfeng2@...wei.com>,
Hulk Robot <hulkci@...wei.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Sasha Levin <sashal@...nel.org>, linux-serial@...r.kernel.org
Subject: [PATCH AUTOSEL 4.19 084/252] tty: omap-serial: remove set but unused variable
From: Xiongfeng Wang <wangxiongfeng2@...wei.com>
[ Upstream commit e83c6587c47caa2278aa3bd603b5a85eddc4cec9 ]
Fix the following warning:
drivers/tty/serial/omap-serial.c: In function serial_omap_rlsi:
drivers/tty/serial/omap-serial.c:496:16: warning: variable ch set but not used [-Wunused-but-set-variable]
The character read is useless according to the table 23-246 of the omap4
TRM. So we can drop it.
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@...wei.com>
Link: https://lore.kernel.org/r/1575617863-32484-1-git-send-email-wangxiongfeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
drivers/tty/serial/omap-serial.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 6420ae581a802..5f808d8dfcd5c 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -493,10 +493,13 @@ static unsigned int check_modem_status(struct uart_omap_port *up)
static void serial_omap_rlsi(struct uart_omap_port *up, unsigned int lsr)
{
unsigned int flag;
- unsigned char ch = 0;
+ /*
+ * Read one data character out to avoid stalling the receiver according
+ * to the table 23-246 of the omap4 TRM.
+ */
if (likely(lsr & UART_LSR_DR))
- ch = serial_in(up, UART_RX);
+ serial_in(up, UART_RX);
up->port.icount.rx++;
flag = TTY_NORMAL;
--
2.20.1
Powered by blists - more mailing lists