Re: [PATCH v4 2/4] serial: 8250_dw: build Renesas RZN1 CPR value from DW_UART_CPR_* definitions

Andy Shevchenko
2026-04-24T13:28:01Z

On Fri, Apr 24, 2026 at 02:38:56PM +0300, Ilpo Järvinen wrote:
> On Fri, 24 Apr 2026, Jia Wang wrote:

...

> Hmm, maybe there should also be macro also for this one which takes the
> fifosize as input and converts it to CPR field vlaue (effectively, the
> macro is an inverse of DW_UART_CPR_FIFO_SIZE()). It would be more readable
> than the literal.

But this can be done separately, right?

> Also include BUILD_BUG_ON(!IS_ALIGNED(fifosize, 16) + bounds checks)
> inside that macro to catch invalid fifo sizes (+ don't forget the
> necessary headers for those two new things).

Hmm... Some devices may have FIFO = 8 or 4 bytes (Intel Quark IIRC has less
than 16 and it's DW IP).

--
With Best Regards,
Andy Shevchenko