[PATCH v2] gpio: rockchip: resolve overflow issues

Andy Shevchenko andriy.shevchenko at linux.intel.com
Fri Aug 23 07:49:13 PDT 2024


On Fri, Aug 23, 2024 at 06:59:40PM +0800, Shawn Lin wrote:
> 在 2024/8/23 11:43, Ye Zhang 写道:

...

> > -		max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
> > +		div = (u64)(GENMASK(23, 0) + 1) * 2 * 1000000;
> > +		max_debounce = DIV_ROUND_CLOSEST_ULL(div, freq);
> 
> can't max_debounce = DIV_ROUND_CLOSEST_ULL((GENMASK(23, 0) + 1) * 2 *
> 1000000, freq) work?

Wouldn't be too long line in this case?

-- 
With Best Regards,
Andy Shevchenko





More information about the Linux-rockchip mailing list