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: <c0ef766d-198-b257-9291-cee7a6f890fa@linux.intel.com>
Date:   Sat, 25 Jun 2022 13:21:41 +0300 (EEST)
From:   Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To:     Lino Sanfilippo <LinoSanfilippo@....de>
cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>, robh+dt@...nel.org,
        krzysztof.kozlowski+dt@...aro.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        vz@...ia.com, linux-arm-kernel@...ts.infradead.org,
        devicetree@...r.kernel.org,
        linux-serial <linux-serial@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>, lukas@...ner.de,
        p.rosenberger@...bus.com, Lino Sanfilippo <l.sanfilippo@...bus.com>
Subject: Re: [PATCH 6/8] serial: 8250_dwlib: remove redundant sanity check
 for RS485 flags

On Wed, 22 Jun 2022, Lino Sanfilippo wrote:

> From: Lino Sanfilippo <l.sanfilippo@...bus.com>
> 
> Before the drivers rs485_config() function is called the serial core
> already ensures that only one of both options RTS on send or RTS after send
> is set. So remove the concerning sanity check in the driver function to
> avoid redundancy.
> 
> Signed-off-by: Lino Sanfilippo <l.sanfilippo@...bus.com>
> ---
>  drivers/tty/serial/8250/8250_dwlib.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c
> index c83e7eaf3877..bed2bd6b7a01 100644
> --- a/drivers/tty/serial/8250/8250_dwlib.c
> +++ b/drivers/tty/serial/8250/8250_dwlib.c
> @@ -95,16 +95,10 @@ static int dw8250_rs485_config(struct uart_port *p, struct serial_rs485 *rs485)
>  	if (rs485->flags & SER_RS485_ENABLED) {
>  		tcr |= DW_UART_TCR_RS485_EN;
>  
> -		if (rs485->flags & SER_RS485_RX_DURING_TX) {
> +		if (rs485->flags & SER_RS485_RX_DURING_TX)
>  			tcr |= DW_UART_TCR_XFER_MODE_DE_DURING_RE;
> -		} else {
> -			/* HW does not support same DE level for tx and rx */
> -			if (!(rs485->flags & SER_RS485_RTS_ON_SEND) ==
> -			    !(rs485->flags & SER_RS485_RTS_AFTER_SEND))
> -				return -EINVAL;
> -
> +		else
>  			tcr |= DW_UART_TCR_XFER_MODE_DE_OR_RE;
> -		}
>  		dw8250_writel_ext(p, DW_UART_DE_EN, 1);
>  		dw8250_writel_ext(p, DW_UART_RE_EN, 1);
>  	} else {
> -- 

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>


-- 
 i.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ