Thread (29 messages) 29 messages, 7 authors, 2024-08-23

Re: [PATCH v2] gpio: rockchip: resolve overflow issues

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2024-08-23 14:48:09
Also in: linux-gpio, linux-rockchip, lkml

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


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help