[PATCH v2 071/148] net/ice/base: match code style to upstream
Anatoly Burakov
anatoly.burakov at intel.com
Wed Jun 12 17:01:05 CEST 2024
The out-of-tree shared code has a few places where we differed in how the
variables were used compared to the upstream. Match what's upstream to reduce the
difference between the out-of-tree and upstream drivers.
Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
---
drivers/net/ice/base/ice_ptp_hw.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c
index 1ba8afa544..ddcadf603c 100644
--- a/drivers/net/ice/base/ice_ptp_hw.c
+++ b/drivers/net/ice/base/ice_ptp_hw.c
@@ -3806,9 +3806,9 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,
enum ice_ptp_fec_mode fec_mode, u64 *pmd_adj)
{
u64 cur_freq, clk_incval, tu_per_sec, mult, adj;
- u32 pmd_adj_divisor, val;
- int err;
u8 pmd_align;
+ u32 val;
+ int err;
err = ice_read_phy_reg_e822(hw, port, P_REG_PMD_ALIGNMENT, &val);
if (err) {
@@ -3825,9 +3825,6 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,
/* Calculate TUs per second */
tu_per_sec = cur_freq * clk_incval;
- /* Get the link speed dependent PMD adjustment divisor */
- pmd_adj_divisor = e822_vernier[link_spd].pmd_adj_divisor;
-
/* The PMD alignment adjustment measurement depends on the link speed,
* and whether FEC is enabled. For each link speed, the alignment
* adjustment is calculated by dividing a value by the length of
@@ -3892,7 +3889,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,
*/
adj = DIV_U64(tu_per_sec, 125);
adj *= mult;
- adj = DIV_U64(adj, pmd_adj_divisor);
+ adj = DIV_U64(adj, e822_vernier[link_spd].pmd_adj_divisor);
/* Finally, for 25G-RS and 50G-RS, a further adjustment for the Rx
* cycle count is necessary.
@@ -3915,7 +3912,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,
cycle_adj = DIV_U64(tu_per_sec, 125);
cycle_adj *= mult;
- cycle_adj = DIV_U64(cycle_adj, pmd_adj_divisor);
+ cycle_adj = DIV_U64(cycle_adj, e822_vernier[link_spd].pmd_adj_divisor);
adj += cycle_adj;
}
@@ -3937,7 +3934,7 @@ ice_phy_calc_pmd_adj_e822(struct ice_hw *hw, u8 port,
cycle_adj = DIV_U64(tu_per_sec, 125);
cycle_adj *= mult;
- cycle_adj = DIV_U64(cycle_adj, pmd_adj_divisor);
+ cycle_adj = DIV_U64(cycle_adj, e822_vernier[link_spd].pmd_adj_divisor);
adj += cycle_adj;
}
--
2.43.0
More information about the dev
mailing list