From 9ed3f75f67c3e5f00f910c8d7497ebed63851b5a Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Mon, 17 Oct 2022 20:53:03 -0700 Subject: [PATCH] Fix MISRA violation (#1109) --- board/safety/safety_hyundai_canfd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/safety/safety_hyundai_canfd.h b/board/safety/safety_hyundai_canfd.h index f590391d09..750b94dbca 100644 --- a/board/safety/safety_hyundai_canfd.h +++ b/board/safety/safety_hyundai_canfd.h @@ -212,7 +212,7 @@ static int hyundai_canfd_tx_hook(CANPacket_t *to_send, bool longitudinal_allowed // steering const int steer_addr = (hyundai_canfd_hda2 && !hyundai_longitudinal) ? 0x50 : 0x12a; if (addr == steer_addr) { - int desired_torque = (((GET_BYTE(to_send, 6) & 0xFU) << 7U) | (GET_BYTE(to_send, 5) >> 1U)) - 1024; + int desired_torque = (((GET_BYTE(to_send, 6) & 0xFU) << 7U) | (GET_BYTE(to_send, 5) >> 1U)) - 1024U; bool steer_req = GET_BIT(to_send, 52U) != 0U; if (steer_torque_cmd_checks(desired_torque, steer_req, HYUNDAI_CANFD_STEERING_LIMITS)) {