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

Anatoly Burakov anatoly.burakov at intel.com
Wed Jun 12 17:01:02 CEST 2024


From: Ian Stokes <ian.stokes at 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 at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
 drivers/net/ice/base/ice_ptp_hw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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:
-- 
2.43.0



More information about the dev mailing list