Re: [PATCH] tty: serial: Add RS422 flag to struct serial_rs485

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux