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:49:19
Also in: linux-gpio, linux-rockchip, lkml

On Fri, Aug 23, 2024 at 06:59:40PM +0800, Shawn Lin wrote:
在 2024/8/23 11:43, Ye Zhang 写道:
...
quoted
-		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


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