[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D9LNZVEKP7VV.2UC5AY0D45CR2@bootlin.com>
Date: Fri, 02 May 2025 14:13:51 +0200
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@...tlin.com>
To: "Andy Shevchenko" <andriy.shevchenko@...el.com>
Cc: "Lee Jones" <lee@...nel.org>, "Rob Herring" <robh@...nel.org>,
"Krzysztof Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley"
<conor+dt@...nel.org>, "Kamel Bouhara" <kamel.bouhara@...tlin.com>, "Linus
Walleij" <linus.walleij@...aro.org>, "Bartosz Golaszewski" <brgl@...ev.pl>,
"Dmitry Torokhov" <dmitry.torokhov@...il.com>,
Uwe Kleine-König <ukleinek@...nel.org>, "Michael Walle"
<mwalle@...nel.org>, "Mark Brown" <broonie@...nel.org>, "Greg
Kroah-Hartman" <gregkh@...uxfoundation.org>, "Rafael J. Wysocki"
<rafael@...nel.org>, "Danilo Krummrich" <dakr@...nel.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-gpio@...r.kernel.org>, <linux-input@...r.kernel.org>,
<linux-pwm@...r.kernel.org>, Grégory Clement
<gregory.clement@...tlin.com>, "Thomas Petazzoni"
<thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH v7 04/11] pwm: max7360: Add MAX7360 PWM support
On Fri May 2, 2025 at 12:19 PM CEST, Andy Shevchenko wrote:
> On Mon, Apr 28, 2025 at 01:57:22PM +0200, mathieu.dubois-briand@...tlin.com wrote:
>> From: Kamel Bouhara <kamel.bouhara@...tlin.com>
>>
>> +static int max7360_pwm_round_waveform_fromhw(struct pwm_chip *chip, struct pwm_device *pwm,
>> + const void *_wfhw, struct pwm_waveform *wf)
>> +{
>> + const struct max7360_pwm_waveform *wfhw = _wfhw;
>> +
>> + wf->period_length_ns = wfhw->enabled ? MAX7360_PWM_PERIOD_NS : 0;
>> + wf->duty_offset_ns = 0;
>> + wf->duty_length_ns = DIV64_U64_ROUND_UP(wfhw->duty_steps * MAX7360_PWM_PERIOD_NS,
>
> Does the numerator have already 64-bit type? Otherwise (u)int*(u)int will be
> just an (u)int.
>
Err no, this section has been modified back and forth, but today we have
u8 * 2 * 1000000L, so we will always fit in a u32.
I will use DIV_ROUND_UP() instead.
> ...
OK with all other comments.
Thanks for your review.
Mathieu
--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists