x86/tsc: Use div64_ul instead of do_div()
PATCH 2/3 x86/tsc: Use div64_ul instead of do_div()
do_div() truncates a u64 divisor to 32 bit.
This can lead to non-zero being truncated to zero for division.
Fix coccinelle warning
WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead
Signed-off-by Jules Irenge <[email protected]>
--- arch/x86/kernel/tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/tsc.c +1 -1
@@ -823,7 +823,7 @@ static unsigned long pit_hpet_ptimer_calibrate_cpu(void)/* Check the reference deviation */ delta = ((u64 ) tsc_pit_min) *100 ; -do_div (delta, tsc_ref_min); +div64_ul (delta, tsc_ref_min);/* * If both calibration results are inside a 10% window
Signature · 1 line
2.43.2