Re: [PATCH v3 2/2] serial: core: Don't clobber the baud rate on hangup via B0
From: Johan Hovold
Date: Wed Nov 04 2026 - 06:33:34 EST
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