From: Yury Norov Date: Mon, 27 Apr 2026 21:41:26 +0000 (-0400) Subject: ptp: switch to using FIELD_GET_SIGNED() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f149354ab7d06c172d4742ff677c896416fe9fbc;p=thirdparty%2Fkernel%2Flinux.git ptp: switch to using FIELD_GET_SIGNED() Switch from sign_extend32(FIELD_GET()) to the dedicated FIELD_GET_SIGNED() and don't calculate the fields length explicitly. Signed-off-by: Yury Norov --- diff --git a/drivers/ptp/ptp_fc3.c b/drivers/ptp/ptp_fc3.c index 70002500170ea..f0e000428a3f4 100644 --- a/drivers/ptp/ptp_fc3.c +++ b/drivers/ptp/ptp_fc3.c @@ -55,8 +55,8 @@ static s64 tdc_meas2offset(struct idtfc3 *idtfc3, u64 meas_read) { s64 coarse, fine; - fine = sign_extend64(FIELD_GET(FINE_MEAS_MASK, meas_read), 12); - coarse = sign_extend64(FIELD_GET(COARSE_MEAS_MASK, meas_read), (39 - 13)); + fine = FIELD_GET_SIGNED(FINE_MEAS_MASK, meas_read); + coarse = FIELD_GET_SIGNED(COARSE_MEAS_MASK, meas_read); fine = div64_s64(fine * NSEC_PER_SEC, idtfc3->tdc_apll_freq * 62LL); coarse = div64_s64(coarse * NSEC_PER_SEC, idtfc3->time_ref_freq);