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] [day] [month] [year] [list]
Date:   Mon, 30 Oct 2023 07:57:06 +0100
From:   Jiri Slaby <jirislaby@...nel.org>
To:     Crescent CY Hsieh <crescentcy.hsieh@...a.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [PATCH] tty: serial: Add RS422 flag to struct serial_rs485

On 30. 10. 23, 6:36, Crescent CY Hsieh wrote:
> @@ -1371,11 +1371,26 @@ static void uart_sanitize_serial_rs485(struct uart_port *port, struct serial_rs4
>   {
>   	u32 supported_flags = port->rs485_supported.flags;
>   
> -	if (!(rs485->flags & SER_RS485_ENABLED)) {
> +	if (!(rs485->flags & (SER_RS485_ENABLED | SER_RS422_ENABLED))) {
>   		memset(rs485, 0, sizeof(*rs485));
>   		return;
>   	}
>   
> +	/* Pick sane setting if the user enables both interfaces */
> +	if (rs485->flags & (SER_RS485_ENABLED | SER_RS422_ENABLED)) {

This would have to be:
if (rs485->flags & (SER_RS485_ENABLED | SER_RS422_ENABLED) == 
SER_RS485_ENABLED | SER_RS422_ENABLED)

But your previous version:
   rs485->flags & SER_RS485_ENABLED && rs485->flags & SER_RS422_ENABLED
looked better in this case.

thanks,
-- 
js
suse labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ