ANDROID: KVM: arm64: Fix div type in hyp_trace clock
do_div is only for 32-bits integers. Use the div64_u64() variant instead. Bug: 357781595 Bug: 273748186 Change-Id: I7718373f0eb1373e90c1dd7b685ba3be89f93cc1 Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
This commit is contained in:
@@ -122,15 +122,7 @@ static void __hyp_clock_work(struct work_struct *work)
|
||||
err / NSEC_PER_USEC);
|
||||
}
|
||||
|
||||
if (delta_boot > U32_MAX) {
|
||||
do_div(delta_boot, NSEC_PER_SEC);
|
||||
rate = delta_cycles;
|
||||
} else {
|
||||
rate = delta_cycles * NSEC_PER_SEC;
|
||||
}
|
||||
|
||||
do_div(rate, delta_boot);
|
||||
|
||||
rate = div64_u64(delta_cycles * NSEC_PER_SEC, delta_boot);
|
||||
clocks_calc_mult_shift(&hyp_clock->mult, &hyp_clock->shift,
|
||||
rate, NSEC_PER_SEC, CLOCK_MAX_CONVERSION_S);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user