Skip to content

Commit 0013881

Browse files
kolacinskikarolanguy11
authored andcommitted
ice: Use div64_u64 instead of div_u64 in adjfine
Change the division in ice_ptp_adjfine from div_u64 to div64_u64. div_u64 is used when the divisor is 32 bit but in this case incval is 64 bit and it caused incorrect calculations and incval adjustments. Fixes: 06c16d8 ("ice: register 1588 PTP clock device object for E810 devices") Signed-off-by: Karol Kolacinski <[email protected]> Tested-by: Gurucharan G <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 3dd7d40 commit 0013881

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/intel/ice/ice_ptp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ static int ice_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm)
705705
scaled_ppm = -scaled_ppm;
706706
}
707707

708-
while ((u64)scaled_ppm > div_u64(U64_MAX, incval)) {
708+
while ((u64)scaled_ppm > div64_u64(U64_MAX, incval)) {
709709
/* handle overflow by scaling down the scaled_ppm and
710710
* the divisor, losing some precision
711711
*/

0 commit comments

Comments
 (0)