Thread (7 messages) flat view 7 messages, 6 authors, 2021-03-25

Re: [PATCH] ptp_qoriq: fix overflow in ptp_qoriq_adjfine() u64 calcalation

From: Richard Cochran <richardcochran@gmail.com>
Date: 2021-03-25 00:18:51

On Tue, Mar 23, 2021 at 04:02:29PM +0800, Yangbo Lu wrote:
Current calculation for diff of TMR_ADD register value may have
64-bit overflow in this code line, when long type scaled_ppm is
large.

adj *= scaled_ppm;

This patch is to resolve it by using mul_u64_u64_div_u64().

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help