ice: Use div64_u64 instead of div_u64 in adjfine
Subsystems (2)
PATCH 1/1 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.
--- drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_ptp.c +1 -1
@@ -1104,7 +1104,7 @@ static int ice_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm) scaled_ppm = -scaled_ppm; } -while ((u64 )scaled_ppm >div_u64 (U64_MAX , incval)) { +while ((u64 )scaled_ppm >div64_u64 (U64_MAX , incval)) {/* handle overflow by scaling down the scaled_ppm and * the divisor, losing some precision */
Signature · 1 line
2.32.0
G
PATCH 1/1 ice: Use div64_u64 instead of div_u64 in adjfine
Quoted 11 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Karol Kolacinski
Sent: Thursday, November 4, 2021 7:22 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Kolacinski, Karol <[email protected]>
Subject: [Intel-wired-lan] [PATCH intel-next] ice: Usediv64_u64instead ofdiv_u64in adjfine
Quoted 9 lines
Change the division in
ice_ptp_adjfinefromdiv_u64todiv64_u64.div_u64is used when the divisor is 32 bit but in this case incval is 64 bit and it caused incorrect calculations and incval adjustments.Signed-off-by Karol Kolacinski <[email protected]>--- drivers/net/ethernet/intel/ice/ice_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)