From: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v2] tty: serial: Add RS422 flag to struct serial_rs485
Date: Tue, 7 Nov 2023 11:55:48 +0800 [thread overview]
Message-ID: <ZUm1RD2icq+Vh6Cp@moxa-ThinkCentre-M90t> (raw)
In-Reply-To: <3fc18b13-fef0-439e-abf0-1fe4e46b224a@gmx.de>
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
prev parent reply other threads:[~2023-11-07 3:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-01 6:44 [PATCH v2] tty: serial: Add RS422 flag to struct serial_rs485 Crescent CY Hsieh
2023-11-01 6:49 ` Greg Kroah-Hartman
2023-11-03 10:47 ` Crescent CY Hsieh
2023-11-04 20:03 ` Lino Sanfilippo
2023-11-04 19:53 ` Lino Sanfilippo
2023-11-06 7:19 ` Crescent CY Hsieh
2023-11-06 14:43 ` Lino Sanfilippo
2023-11-07 3:55 ` Crescent CY Hsieh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZUm1RD2icq+Vh6Cp@moxa-ThinkCentre-M90t \
--to=crescentcy.hsieh@moxa.com \
--cc=LinoSanfilippo@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox