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

Andy Shevchenko <[email protected]>
Newsgroups org.kernel.vger.linux-serial,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Organization Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.