From: Jiri Slaby <jirislaby@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Christian Marangi <ansuelsmth@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Benjamin Larsson" <benjamin.larsson@genexis.eu>,
"John Ogness" <john.ogness@linutronix.de>,
"Peng Zhang" <zhangpeng.00@bytedance.com>,
"Jacques Nilo" <jnilo@free.fr>,
"Rong Zhang" <rongrong@oss.cipunited.com>,
"Gerhard Engleder" <eg@keba.com>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Binbin Zhou" <zhoubinbin@loongson.cn>,
"Lubomir Rintel" <lkundrak@v3.sk>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 2/2] serial: 8250: Add Airoha SoC UART and HSUART support
Date: Fri, 7 Aug 2026 06:55:11 +0200 [thread overview]
Message-ID: <e0704a22-6a21-4f8f-b1a7-ae200bdbcfae@kernel.org> (raw)
In-Reply-To: <anUQhbuHSDRs04bq@ashevche-desk.local>
On 07. 08. 26, 0:53, Andy Shevchenko wrote:
> On Fri, Jul 24, 2026 at 08:30:06PM +0200, Christian Marangi wrote:
>> + /*
>> + * Calculate XYD_x and XINCLKDR register by searching
>> + * through a table of crystal_clock divisors.
>> + */
>> + nom = baud * XYD_Y;
>
>> + 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?
> 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);
>
thanks,
--
js
suse labs
next prev parent reply other threads:[~2026-08-07 4:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 18:30 [PATCH v2 0/2] serial: 8250: Add AN7581 UART support Christian Marangi
2026-07-24 18:30 ` [PATCH v2 1/2] dt-bindings: serial: 8250: Add Airoha compatibles Christian Marangi
2026-07-24 18:30 ` [PATCH v2 2/2] serial: 8250: Add Airoha SoC UART and HSUART support Christian Marangi
2026-07-27 8:51 ` Ilpo Järvinen
2026-08-06 22:18 ` Andy Shevchenko
2026-08-06 22:53 ` Andy Shevchenko
2026-08-06 22:56 ` Andy Shevchenko
2026-08-07 4:55 ` Jiri Slaby [this message]
2026-07-30 14:54 ` [PATCH v2 0/2] serial: 8250: Add AN7581 UART support Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e0704a22-6a21-4f8f-b1a7-ae200bdbcfae@kernel.org \
--to=jirislaby@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=ansuelsmth@gmail.com \
--cc=benjamin.larsson@genexis.eu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=eg@keba.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jiaxun.yang@flygoat.com \
--cc=jnilo@free.fr \
--cc=john.ogness@linutronix.de \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=lkundrak@v3.sk \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=rongrong@oss.cipunited.com \
--cc=zhangpeng.00@bytedance.com \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox