lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9246bc67-518a-72b9-beaf-3204a4a977@linux.intel.com>
Date:   Thu, 7 Dec 2023 14:50:59 +0200 (EET)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     "Jiri Slaby (SUSE)" <jirislaby@...nel.org>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-serial <linux-serial@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 21/27] tty: nozomi: convert to u8 and size_t

On Wed, 6 Dec 2023, Jiri Slaby (SUSE) wrote:

> Switch character types to u8 and sizes to size_t. To conform to
> characters/sizes in the rest of the tty layer.
> 
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@...nel.org>
> ---
>  drivers/tty/nozomi.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
> index b247341bd12f..e28a921c1637 100644
> --- a/drivers/tty/nozomi.c
> +++ b/drivers/tty/nozomi.c
> @@ -783,11 +783,10 @@ static int receive_data(enum port_type index, struct nozomi *dc)
>  			tty_insert_flip_char(&port->port, buf[0], TTY_NORMAL);
>  			size = 0;
>  		} else if (size < RECEIVE_BUF_MAX) {
> -			size -= tty_insert_flip_string(&port->port,
> -					(char *)buf, size);
> +			size -= tty_insert_flip_string(&port->port, buf, size);
>  		} else {
> -			i = tty_insert_flip_string(&port->port,
> -					(char *)buf, RECEIVE_BUF_MAX);
> +			i = tty_insert_flip_string(&port->port, buf,
> +						   RECEIVE_BUF_MAX);
>  			size -= i;
>  			offset += i;
>  		}
> @@ -1584,10 +1583,10 @@ static void ntty_hangup(struct tty_struct *tty)
>  static ssize_t ntty_write(struct tty_struct *tty, const u8 *buffer,
>  			  size_t count)
>  {
> -	int rval = -EINVAL;
>  	struct nozomi *dc = get_dc_by_tty(tty);
>  	struct port *port = tty->driver_data;
>  	unsigned long flags;
> +	size_t rval;
>  
>  	if (!dc || !port)
>  		return -ENODEV;
> 

It wouldn't hurt to mention in the commit message that -EINVAL 
initialization is unnecessary.

-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ