[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsihI71S8ep7j_Ke@smile.fi.intel.com>
Date: Fri, 23 Aug 2024 17:48:03 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ye Zhang <ye.zhang@...k-chips.com>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, heiko@...ech.de,
linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
mika.westerberg@...ux.intel.com, tao.huang@...k-chips.com,
finley.xiao@...k-chips.com, tim.chen@...k-chips.com,
elaine.zhang@...k-chips.com
Subject: Re: [PATCH v2] gpio: rockchip: resolve overflow issues
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
Powered by blists - more mailing lists