Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1241783 > unrolled thread

[PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()

Started byTimur Tabi <timur@codeaurora.org>
First post2015-10-07 22:30 +0200
Last post2015-10-16 14:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty() Timur Tabi <timur@codeaurora.org> - 2015-10-07 22:30 +0200
    Re: [PATCH] serial: amba-pl011: fix incorrect integer size in  pl011_fifo_to_tty() Dave Martin <Dave.Martin@arm.com> - 2015-10-16 14:50 +0200

#1241783 — [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()

FromTimur Tabi <timur@codeaurora.org>
Date2015-10-07 22:30 +0200
Subject[PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
Message-ID<qh3vA-78b-9@gated-at.bofh.it>
The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
to hold that value.  The result is that UART_DUMMY_DR_RX is never passed
to uart_insert_char().  This means that we're always accepting characters,
even when CREAD (in termios) is not set.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
---
 drivers/tty/serial/amba-pl011.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index fd27e98..899a771 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -191,8 +191,8 @@ struct uart_amba_port {
  */
 static int pl011_fifo_to_tty(struct uart_amba_port *uap)
 {
-	u16 status, ch;
-	unsigned int flag, max_count = 256;
+	u16 status;
+	unsigned int ch, flag, max_count = 256;
 	int fifotaken = 0;
 
 	while (max_count--) {
-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1248709 — Re: [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()

FromDave Martin <Dave.Martin@arm.com>
Date2015-10-16 14:50 +0200
SubjectRe: [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
Message-ID<qkcCl-6zl-5@gated-at.bofh.it>
In reply to#1241783
On Wed, Oct 07, 2015 at 03:27:16PM -0500, Timur Tabi wrote:
> The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
> to hold that value.  The result is that UART_DUMMY_DR_RX is never passed
> to uart_insert_char().  This means that we're always accepting characters,
> even when CREAD (in termios) is not set.
> 
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
> ---
>  drivers/tty/serial/amba-pl011.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index fd27e98..899a771 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -191,8 +191,8 @@ struct uart_amba_port {
>   */
>  static int pl011_fifo_to_tty(struct uart_amba_port *uap)
>  {
> -	u16 status, ch;
> -	unsigned int flag, max_count = 256;
> +	u16 status;
> +	unsigned int ch, flag, max_count = 256;
>  	int fifotaken = 0;

FWIW,

Reviewed-by: Dave Martin <Dave.Martin@arm.com>

I guess this tells us something about how often !CREAD is used...

Cheers
---Dave

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web