Re: [PATCH v2] gpio: rockchip: resolve overflow issues
From: Andy Shevchenko
Date: Fri Aug 23 2024 - 10:48:31 EST
On Fri, Aug 23, 2024 at 11:43:06AM +0800, Ye Zhang wrote:
> Prevent overflow issues when performing debounce-related calculations.
...
> - max_debounce = (GENMASK(23, 0) + 1) * 2 * 1000000 / freq;
> + div = (u64)(GENMASK(23, 0) + 1) * 2 * 1000000;
You probably want to use HZ_PER_MHZ from units.h or so?
--
With Best Regards,
Andy Shevchenko