[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210709055325.4y4ufjvoiwo2pcvi@pengutronix.de>
Date: Fri, 9 Jul 2021 07:53:25 +0200
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Billy Tsai <billy_tsai@...eedtech.com>
Cc: "lee.jones@...aro.org" <lee.jones@...aro.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"joel@....id.au" <joel@....id.au>,
"andrew@...id.au" <andrew@...id.au>,
"thierry.reding@...il.com" <thierry.reding@...il.com>,
"p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-pwm@...r.kernel.org" <linux-pwm@...r.kernel.org>,
BMC-SW <BMC-SW@...eedtech.com>
Subject: Re: [v8 2/2] pwm: Add Aspeed ast2600 PWM support
Hello Billy,
On Fri, Jul 09, 2021 at 05:40:45AM +0000, Billy Tsai wrote:
> On 2021/7/2, 10:32 PM, "Uwe Kleine-König" <u.kleine-koenig@...gutronix.de> wrote:
> > The multiplication can be up to:
>
> > 100000000 * (1 << 31) * (31 + 1) * (255 + 1)
>
> > right? This needs 71 bits and so might overflow a u64.
>
> No, the multiplication can be up to:
>
> Max(div_h) = 15
> Max(div_l) = 255
> Max(clk_period) = 255
> 1000000000 * (1 << 15) * (255 + 1) * (255 + 1) < 2^64 - 1
> it doesn't overflow a u64.
Ah, you're right. Please note this in a comment (not that you were
right, but that it doesn't overflow :-)
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists