Re: [PATCH v1 1/1] serial: 8520_ce4100: Reuse mem_serial_in() in ce4100_mem_serial_in()
From: Andy Shevchenko
Date: Mon Jun 30 2025 - 09:30:57 EST
On Mon, Jun 30, 2025 at 03:02:11PM +0200, Jiri Slaby wrote:
> On 30. 06. 25, 14:54, Andy Shevchenko wrote:
> > In one place in ce4100_mem_serial_in() the code may be replaced with
> > mem_serial_in() call. Do it so and collapse two conditionals into one.
...
> > u32 ret, ier, lsr;
> > - if (offset != UART_IIR)
> > - return mem_serial_in(p, offset);
> > -
> > - offset <<= p->regshift;
> > -
> > - ret = readl(p->membase + offset);
> > - if (!(ret & UART_IIR_NO_INT))
> > + ret = mem_serial_in(p, offset);
> > + if (!(offset == UART_IIR) && (ret & UART_IIR_NO_INT))
>
> I am in haste, but a misplaced right paren (should be at the end)?
Ah, good catch! It's probably better in the original form, i.e.
if ((offset != UART_IIR) || !(ret & UART_IIR_NO_INT))
What do you think?
--
With Best Regards,
Andy Shevchenko