Re: [PATCH v7 1/6] serial: 8250: make saved LSR larger

Andy Shevchenko
2022-06-15T14:01:31Z

On Wed, Jun 15, 2022 at 03:48:24PM +0300, Ilpo Järvinen wrote:
> DW flags address received as BIT(8) in LSR. In order to not lose that
> on read, enlarge lsr_saved_flags to u16.
>
> Adjust lsr/status variables and related call chains to use u16.
> Technically, some of these type conversion would not be needed but it
> doesn't hurt to be consistent.

...

> static void exar_shutdown(struct uart_port *port)
> {
> - unsigned char lsr;
> + u16 lsr;

I would take a chance and move it under the longer line(s), like after xmit
(taking into account given context).

> bool tx_complete = false;
> struct uart_8250_port *up = up_to_u8250p(port);
> struct circ_buf *xmit = &port->state->xmit;

...

> int fsl8250_handle_irq(struct uart_port *port)
> {
> - unsigned char lsr, orig_lsr;
> + u16 lsr, orig_lsr;

Ditto. And so on.

> unsigned long flags;
> unsigned int iir;
> struct uart_8250_port *up = up_to_u8250p(port);

--
With Best Regards,
Andy Shevchenko