Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH AUTOSEL 5.5 188/542] tty: omap-serial: remove set but unused variable
       [not found] <20200214154854.6746-1-sashal@kernel.org>
@ 2020-02-14 15:43 ` Sasha Levin
  2020-02-14 21:50   ` Greg Kroah-Hartman
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 200/542] tty: serial: amba-pl011: " Sasha Levin
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 222/542] Revert "tty/serial: atmel: fix out of range clock divider handling" Sasha Levin
  2 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2020-02-14 15:43 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Xiongfeng Wang, Hulk Robot, Greg Kroah-Hartman, Sasha Levin,
	linux-serial

From: Xiongfeng Wang <wangxiongfeng2@huawei.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@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Link: https://lore.kernel.org/r/1575617863-32484-1-git-send-email-wangxiongfeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.5 200/542] tty: serial: amba-pl011: remove set but unused variable
       [not found] <20200214154854.6746-1-sashal@kernel.org>
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 188/542] tty: omap-serial: remove set but unused variable Sasha Levin
@ 2020-02-14 15:43 ` " Sasha Levin
  2020-02-14 21:50   ` Greg Kroah-Hartman
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 222/542] Revert "tty/serial: atmel: fix out of range clock divider handling" Sasha Levin
  2 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2020-02-14 15:43 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Xiongfeng Wang, Hulk Robot, Greg Kroah-Hartman, Sasha Levin,
	linux-serial

From: Xiongfeng Wang <wangxiongfeng2@huawei.com>

[ Upstream commit 94345aee285334e9e12fc70572e3d9380791a64e ]

Fix the following warning:
drivers/tty/serial/amba-pl011.c: In function check_apply_cts_event_workaround:
drivers/tty/serial/amba-pl011.c:1461:15: warning: variable dummy_read set but not used [-Wunused-but-set-variable]

The data read is useless and can be dropped.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Link: https://lore.kernel.org/r/1575619526-34482-1-git-send-email-wangxiongfeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/serial/amba-pl011.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 4b28134d596a9..c5e9475feb47a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1452,8 +1452,6 @@ static void pl011_modem_status(struct uart_amba_port *uap)
 
 static void check_apply_cts_event_workaround(struct uart_amba_port *uap)
 {
-	unsigned int dummy_read;
-
 	if (!uap->vendor->cts_event_workaround)
 		return;
 
@@ -1465,8 +1463,8 @@ static void check_apply_cts_event_workaround(struct uart_amba_port *uap)
 	 * single apb access will incur 2 pclk(133.12Mhz) delay,
 	 * so add 2 dummy reads
 	 */
-	dummy_read = pl011_read(uap, REG_ICR);
-	dummy_read = pl011_read(uap, REG_ICR);
+	pl011_read(uap, REG_ICR);
+	pl011_read(uap, REG_ICR);
 }
 
 static irqreturn_t pl011_int(int irq, void *dev_id)
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH AUTOSEL 5.5 222/542] Revert "tty/serial: atmel: fix out of range clock divider handling"
       [not found] <20200214154854.6746-1-sashal@kernel.org>
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 188/542] tty: omap-serial: remove set but unused variable Sasha Levin
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 200/542] tty: serial: amba-pl011: " Sasha Levin
@ 2020-02-14 15:43 ` Sasha Levin
  2020-02-14 21:51   ` Greg Kroah-Hartman
  2 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2020-02-14 15:43 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Greg Kroah-Hartman, Stephen Rothwell, David Engraf, Sasha Levin,
	linux-serial, linux-arm-kernel

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

[ Upstream commit 6dbd54e4154dfe386b3333687de15be239576617 ]

This reverts commit 751d0017334db9c4d68a8909c59f662a6ecbcec6.

The wrong commit got added to the tty-next tree, the correct one is in
the tty-linus branch.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: David Engraf <david.engraf@sysgo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/tty/serial/atmel_serial.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 1ba9bc667e136..ab4d4a0b36497 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2270,6 +2270,9 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
 		mode |= ATMEL_US_USMODE_NORMAL;
 	}
 
+	/* set the mode, clock divisor, parity, stop bits and data size */
+	atmel_uart_writel(port, ATMEL_US_MR, mode);
+
 	/*
 	 * Set the baud rate:
 	 * Fractional baudrate allows to setup output frequency more
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 5.5 200/542] tty: serial: amba-pl011: remove set but unused variable
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 200/542] tty: serial: amba-pl011: " Sasha Levin
@ 2020-02-14 21:50   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-02-14 21:50 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Xiongfeng Wang, Hulk Robot, linux-serial

On Fri, Feb 14, 2020 at 10:43:12AM -0500, Sasha Levin wrote:
> From: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> 
> [ Upstream commit 94345aee285334e9e12fc70572e3d9380791a64e ]
> 
> Fix the following warning:
> drivers/tty/serial/amba-pl011.c: In function check_apply_cts_event_workaround:
> drivers/tty/serial/amba-pl011.c:1461:15: warning: variable dummy_read set but not used [-Wunused-but-set-variable]
> 
> The data read is useless and can be dropped.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> Link: https://lore.kernel.org/r/1575619526-34482-1-git-send-email-wangxiongfeng2@huawei.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/tty/serial/amba-pl011.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index 4b28134d596a9..c5e9475feb47a 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -1452,8 +1452,6 @@ static void pl011_modem_status(struct uart_amba_port *uap)
>  
>  static void check_apply_cts_event_workaround(struct uart_amba_port *uap)
>  {
> -	unsigned int dummy_read;
> -
>  	if (!uap->vendor->cts_event_workaround)
>  		return;
>  
> @@ -1465,8 +1463,8 @@ static void check_apply_cts_event_workaround(struct uart_amba_port *uap)
>  	 * single apb access will incur 2 pclk(133.12Mhz) delay,
>  	 * so add 2 dummy reads
>  	 */
> -	dummy_read = pl011_read(uap, REG_ICR);
> -	dummy_read = pl011_read(uap, REG_ICR);
> +	pl011_read(uap, REG_ICR);
> +	pl011_read(uap, REG_ICR);
>  }
>  
>  static irqreturn_t pl011_int(int irq, void *dev_id)
> -- 
> 2.20.1
> 

Please drop.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 5.5 188/542] tty: omap-serial: remove set but unused variable
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 188/542] tty: omap-serial: remove set but unused variable Sasha Levin
@ 2020-02-14 21:50   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-02-14 21:50 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Xiongfeng Wang, Hulk Robot, linux-serial

On Fri, Feb 14, 2020 at 10:43:00AM -0500, Sasha Levin wrote:
> From: Xiongfeng Wang <wangxiongfeng2@huawei.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@huawei.com>
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
> Link: https://lore.kernel.org/r/1575617863-32484-1-git-send-email-wangxiongfeng2@huawei.com
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Sasha Levin <sashal@kernel.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
>

Please drop.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH AUTOSEL 5.5 222/542] Revert "tty/serial: atmel: fix out of range clock divider handling"
  2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 222/542] Revert "tty/serial: atmel: fix out of range clock divider handling" Sasha Levin
@ 2020-02-14 21:51   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-02-14 21:51 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Stephen Rothwell, David Engraf,
	linux-serial, linux-arm-kernel

On Fri, Feb 14, 2020 at 10:43:34AM -0500, Sasha Levin wrote:
> From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> [ Upstream commit 6dbd54e4154dfe386b3333687de15be239576617 ]
> 
> This reverts commit 751d0017334db9c4d68a8909c59f662a6ecbcec6.
> 
> The wrong commit got added to the tty-next tree, the correct one is in
> the tty-linus branch.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Cc: David Engraf <david.engraf@sysgo.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/tty/serial/atmel_serial.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 1ba9bc667e136..ab4d4a0b36497 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -2270,6 +2270,9 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
>  		mode |= ATMEL_US_USMODE_NORMAL;
>  	}
>  
> +	/* set the mode, clock divisor, parity, stop bits and data size */
> +	atmel_uart_writel(port, ATMEL_US_MR, mode);
> +
>  	/*
>  	 * Set the baud rate:
>  	 * Fractional baudrate allows to setup output frequency more
> -- 
> 2.20.1
> 

Are you sure this is correct to be added?  This was the result of some
fun merge problems, I don't think it's needed anywhere else...

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200214154854.6746-1-sashal@kernel.org>
2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 188/542] tty: omap-serial: remove set but unused variable Sasha Levin
2020-02-14 21:50   ` Greg Kroah-Hartman
2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 200/542] tty: serial: amba-pl011: " Sasha Levin
2020-02-14 21:50   ` Greg Kroah-Hartman
2020-02-14 15:43 ` [PATCH AUTOSEL 5.5 222/542] Revert "tty/serial: atmel: fix out of range clock divider handling" Sasha Levin
2020-02-14 21:51   ` Greg Kroah-Hartman

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git