[v2,068/148] net/ice/base: change tmr_idx to u32

Message ID 4396c169994dfd47182abaec7458dbf9e1564a88.1718204528.git.anatoly.burakov@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Bruce Richardson
Headers
Series Update net/ice base driver to latest upstream snapshot |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Burakov, Anatoly June 12, 2024, 3:01 p.m. UTC
From: Ian Stokes <ian.stokes@intel.com>

When converting to source timer command value, tmr_idx is left shifted by 8
(CPK_SRC_SEL), which overflows the 8-bit data type. Change to 32-bit.

Signed-off-by: Yochai Hagvi <yochai.hagvi@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
---
 drivers/net/ice/base/ice_ptp_hw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_ptp_hw.c b/drivers/net/ice/base/ice_ptp_hw.c
index 62558ac761..31d6c7cf81 100644
--- a/drivers/net/ice/base/ice_ptp_hw.c
+++ b/drivers/net/ice/base/ice_ptp_hw.c
@@ -797,8 +797,7 @@  static int ice_init_cgu_e82x(struct ice_hw *hw)
 static u32 ice_ptp_tmr_cmd_to_src_reg(struct ice_hw *hw,
 				      enum ice_ptp_tmr_cmd cmd)
 {
-	u32 cmd_val;
-	u8 tmr_idx;
+	u32 cmd_val, tmr_idx;
 
 	switch (cmd) {
 	case ICE_PTP_INIT_TIME: