From: Jiri Slaby <jirislaby@kernel.org>
To: Lino Sanfilippo <LinoSanfilippo@gmx.de>,
Greg KH <gregkh@linuxfoundation.org>
Cc: linux@armlinux.org.uk, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] serial: amba-pl011: add RS485 support
Date: Fri, 25 Jun 2021 08:01:36 +0200 [thread overview]
Message-ID: <db436292-4115-0755-57d8-d63986f84453@kernel.org> (raw)
In-Reply-To: <5d7a4351-2adc-ea31-3290-91d91bd5a5d4@gmx.de>
On 25. 06. 21, 2:15, Lino Sanfilippo wrote:
>>> +static int pl011_rs485_config(struct uart_port *port,
>>> + struct serial_rs485 *rs485)
>>> +{
>>> + struct uart_amba_port *uap =
>>> + container_of(port, struct uart_amba_port, port);
>>> +
>>> + /* pick sane settings if the user hasn't */
>>> + if (!!(rs485->flags & SER_RS485_RTS_ON_SEND) ==
>>
>> Why the !! in an if statement?
>>
>>> + !!(rs485->flags & SER_RS485_RTS_AFTER_SEND)) {
>>
>> Same here, why?
>>
>
> This was copied from serial8250_em485_config(). But I think we can simply use
>
> if (rs485->flags & SER_RS485_RTS_AFTER_SEND)
> rs485->flags &= ~SER_RS485_RTS_ON_SEND;
> else
> rs485->flags |= SER_RS485_RTS_ON_SEND;
>
> instead. I will adjust the code accordingly.
This is different. You want to set ON_SEND when none is set. And unset
AFTER_SEND when both are set. In your code, when both are set, you leave
AFTER_SEND.
regards,
--
js
suse labs
next prev parent reply other threads:[~2021-06-25 6:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-18 14:51 [PATCH v2] serial: amba-pl011: add RS485 support Lino Sanfilippo
2021-06-24 12:55 ` Greg KH
2021-06-25 0:15 ` Lino Sanfilippo
2021-06-25 6:01 ` Jiri Slaby [this message]
2021-06-25 11:21 ` Lino Sanfilippo
2021-06-26 3:41 ` Jiri Slaby
2021-06-29 9:46 ` Lino Sanfilippo
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=db436292-4115-0755-57d8-d63986f84453@kernel.org \
--to=jirislaby@kernel.org \
--cc=LinoSanfilippo@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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