lkml.org 
[lkml]   [2023]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v9 4/6] pwm: dwc: use clock rate in hz to avoid rounding issues
Hello Ben,

On Mon, Sep 11, 2023 at 08:33:02AM +0100, Ben Dooks wrote:
> On 07/09/2023 22:34, Uwe Kleine-König wrote:
> > > + duty *= NSEC_PER_SEC;
> > > + period *= NSEC_PER_SEC;
> >
> > A comment that/why this cannot overflow would be nice. (I didn't check,
> > maybe it can?)
>
> I /think/ that as long as NSEC_PER_SEC 2^32 then this shouldn't
> overflow.

I guess NSEC_PER_SEC won't change in the near future :-)

double checking and writing the result down in a comment would be
appreciated.

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-09-11 23:56    [W:0.071 / U:1.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site