From: Johan Hovold <johan@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Maciej W. Rozycki" <macro@orcam.me.uk>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Uwe Kleine-König (The Capable Hub)"
<u.kleine-koenig@baylibre.com>,
"Crescent Hsieh" <crescentcy.hsieh@moxa.com>,
"Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"John Ogness" <john.ogness@linutronix.de>,
"Karl Mehltretter" <kmehltretter@gmail.com>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v3 2/2] serial: core: Don't clobber the baud rate on hangup via B0
Date: Wed, 4 Nov 2026 12:28:22 +0100 [thread overview]
Message-ID: <ausW1pwp2eBCqVsM@hovoldconsulting.com> (raw)
In-Reply-To: <ausSmrErzTXfKNGU@ashevche-desk.local>
On Wed, Nov 04, 2026 at 01:10:18PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 03, 2026 at 10:07:58PM +0000, Maciej W. Rozycki wrote:
> > if (baud == 0)
> > - baud = max(min, 9600);
> > + baud = (port->hup_speed ?
> > + port->hup_speed : max(min, 9600));
>
> Outer parentheses are redundant. Also use Elvis.
>
> baud = port->hup_speed ?: max(min, 9600);
No, don't.
Don't use the ternary operator at all as it tends to make code less
readable.
Johan
next prev parent reply other threads:[~2026-11-04 11:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 22:07 [PATCH v3 0/2] serial: core: Don't clobber the baud rate on hangup via B0 Maciej W. Rozycki
2026-11-03 22:07 ` [PATCH v3 1/2] serial: core: Unify uart_get_baud_rate() success return paths Maciej W. Rozycki
2026-11-03 22:23 ` sashiko-bot
2026-11-04 11:11 ` Andy Shevchenko
2026-11-03 22:07 ` [PATCH v3 2/2] serial: core: Don't clobber the baud rate on hangup via B0 Maciej W. Rozycki
2026-11-03 22:22 ` sashiko-bot
2026-11-04 11:10 ` Andy Shevchenko
2026-11-04 11:28 ` Johan Hovold [this message]
2026-11-04 11:50 ` Greg Kroah-Hartman
2026-11-04 11:52 ` Andy Shevchenko
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=ausW1pwp2eBCqVsM@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=crescentcy.hsieh@moxa.com \
--cc=gregkh@linuxfoundation.org \
--cc=hvilleneuve@dimonoff.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=kmehltretter@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=macro@orcam.me.uk \
--cc=u.kleine-koenig@baylibre.com \
/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