From: Jiri Slaby <jirislaby@kernel.org>
To: Crescent CY Hsieh <crescentcy.hsieh@moxa.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH] tty: serial: Add RS422 flag to struct serial_rs485
Date: Mon, 30 Oct 2023 07:57:06 +0100 [thread overview]
Message-ID: <52c48e40-0c1e-48ff-9ff0-3dbca4b04f91@kernel.org> (raw)
In-Reply-To: <20231030053632.5109-1-crescentcy.hsieh@moxa.com>
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
prev parent reply other threads:[~2023-10-30 6:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 5:36 Crescent CY Hsieh
2023-10-30 6:57 ` Jiri Slaby [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=52c48e40-0c1e-48ff-9ff0-3dbca4b04f91@kernel.org \
--to=jirislaby@kernel.org \
--cc=crescentcy.hsieh@moxa.com \
--cc=gregkh@linuxfoundation.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
all inboxes | Powered by JetHome®