Skip to contentSkip to conversation

32-bit clocks can't round above 2**31

PATCH John Watts 2 participants 2 messages Oct 16, 2025 Common clk

lore
Share & tools
lore

John Watts

author
#0 lore raw

Hi, just a small bug I spotted when debugging some code. Hope this helps.

drivers/clk/clk.c +1 -1
@@ -1572,7 +1572,7 @@ late_initcall_sync(clk_disable_unused);
 static int clk_core_determine_round_nolock(struct clk_core *core,
                                           struct clk_rate_request *req)
 {
-       long rate;
+       unsigned long rate;
 
        lockdep_assert_held(&prepare_lock);
 
maintainer
#1 lore raw

Quoting John Watts (2025-10-16 03:09:07)

Quoted 1 line

Hi, just a small bug I spotted when debugging some code. Hope this helps.

Please submit a proper patch. Thanks!

Quoted 12 lines
drivers/clk/clk.c +1 -1
@@ -1572,7 +1572,7 @@ late_initcall_sync(clk_disable_unused);
 static int clk_core_determine_round_nolock(struct clk_core *core,
                                           struct clk_rate_request *req)
 {
-       long rate;
+       unsigned long rate;
 
        lockdep_assert_held(&prepare_lock);