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]
Message-ID: <ZUm1RD2icq+Vh6Cp@moxa-ThinkCentre-M90t>
Date:   Tue, 7 Nov 2023 11:55:48 +0800
From:   Crescent CY Hsieh <crescentcy.hsieh@...a.com>
To:     Lino Sanfilippo <LinoSanfilippo@....de>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Jiri Slaby <jirislaby@...nel.org>,
        linux-kernel@...r.kernel.org, linux-serial@...r.kernel.org
Subject: Re: [PATCH v2] tty: serial: Add RS422 flag to struct serial_rs485

On Mon, Nov 06, 2023 at 03:43:49PM +0100, Lino Sanfilippo wrote:
> On 06.11.23 08:19, Crescent CY Hsieh wrote:
> > On Sat, Nov 04, 2023 at 08:53:18PM +0100, Lino Sanfilippo wrote:
> > > 
> > > Maybe it would be better to change the meaning of the flag: Instead of being a substitution for
> > > SER_RS485_ENABLED, it could be used to mark a special mode.
> > > So if both SER_RS485_ENABLED and SER_RS485_MODE_RS422 are set it would mean that we have RS422.
> > 
> > RS422 is not a mode of RS485, so I think using two flags to represent
> > them is much more reasonable, even though they are both included in the
> > "struct serial_rs485".
> 
> Yes, RS422 is not a mode of RS485, but you are already using the rs485 (and not a rs422) structure.
> And treating RS422 as a different mode in the existing code would make things much easier and keep the code
> clean. For example you would not have to alter all the code places that check for SER_RS485_ENABLED.
> Also SER_RS485_ENABLED and SER_RS422_ENABLED would have the exact same effect, so why use two
> different flags, when the effect is the same?

Agree, by treating RS422 as a mode, it would make things easier.

However, I think, eventually, RS422 might add some configuration flags
and should be distinguished from RS485 (Perhaps by adding RS422
structure or revising the name of RS485 structure...) But this should be
a future work and require more discussion.

Anyway, I will see RS422 as a mode in the next patch. Thanks for the
suggestion.

---
Sincerely,
Crescent CY Hsieh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ