Re: [PATCH v2 2/2] serial: 8250: Add Airoha SoC UART and HSUART support

From: Andy Shevchenko

Date: Sat Aug 08 2026 - 15:46:22 EST


On Fri, Aug 07, 2026 at 06:55:11AM +0200, Jiri Slaby wrote:
> On 07. 08. 26, 0:53, Andy Shevchenko wrote:
> > On Fri, Jul 24, 2026 at 08:30:06PM +0200, Christian Marangi wrote:

...

> > > + for (i = 0 ; i < ARRAY_SIZE(airoha_clk_div_info) ; i++) {
> > > + clk_div_info = &airoha_clk_div_info[i];
> > > + xindiv_clk = XINDIV_CLOCK / clk_div_info->div;
> >
> > for (unsigned int i = ARRAY_SIZE(airoha_clk_div_info) - 1; i >= 0; i--) {
>
> Due to unsignedness, isn't this a lopp for ever?

Oh, true! In the v3 it seems using correct type (signed one).

> > xindiv_clk = XINDIV_CLOCK / BIT(i);
> >
> > Also variant (but may be a little bit confusing)
>
> But a little bit more correct :).
>
> > for (unsigned int i = ARRAY_SIZE(airoha_clk_div_info); i; i--) {
> > xindiv_clk = XINDIV_CLOCK / BIT(i - 1);

--
With Best Regards,
Andy Shevchenko