From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754223AbbJPMsM (ORCPT ); Fri, 16 Oct 2015 08:48:12 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:37681 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754194AbbJPMsL convert rfc822-to-8bit (ORCPT ); Fri, 16 Oct 2015 08:48:11 -0400 Date: Fri, 16 Oct 2015 13:48:03 +0100 From: Dave Martin To: Timur Tabi Cc: Greg Kroah-Hartman , Russell King , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty() Message-ID: <20151016124733.GA4801@e103592.cambridge.arm.com> References: <1444249636-25661-1-git-send-email-timur@codeaurora.org> MIME-Version: 1.0 In-Reply-To: <1444249636-25661-1-git-send-email-timur@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-OriginalArrivalTime: 16 Oct 2015 12:48:06.0990 (UTC) FILETIME=[E7AE16E0:01D10810] X-MC-Unique: OQgE6zaXTVOPyfowisJ0Jw-1 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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 I guess this tells us something about how often !CREAD is used... Cheers ---Dave From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave.Martin@arm.com (Dave Martin) Date: Fri, 16 Oct 2015 13:48:03 +0100 Subject: [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty() In-Reply-To: <1444249636-25661-1-git-send-email-timur@codeaurora.org> References: <1444249636-25661-1-git-send-email-timur@codeaurora.org> Message-ID: <20151016124733.GA4801@e103592.cambridge.arm.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 > --- > 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 I guess this tells us something about how often !CREAD is used... Cheers ---Dave