@@ -491,11 +491,9 @@ rkcanfd_handle_error_int_reg_ec(struct rkcanfd_priv *priv, struct can_frame *cf,
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_CRC)
cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK_EOF)
- cf->data[3] = CAN_ERR_PROT_LOC_ACK;
+ cf->data[3] = CAN_ERR_PROT_LOC_ACK_DEL;
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK)
cf->data[3] = CAN_ERR_PROT_LOC_ACK;
- else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_ACK_EOF)
- cf->data[3] = CAN_ERR_PROT_LOC_ACK_DEL;
/* RKCANFD_REG_ERROR_CODE_TX_ERROR */
else if (reg_ec & RKCANFD_REG_ERROR_CODE_TX_OVERLOAD)
cf->data[2] |= CAN_ERR_PROT_OVERLOAD;
Probably due to a copy/paste error rkcanfd_handle_error_int_reg_ec() checks twice if the RKCANFD_REG_ERROR_CODE_TX_ACK_EOF bit is set in reg_ec. Keep the correct check for RKCANFD_REG_ERROR_CODE_TX_ACK_EOF and remove the superfluous one. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://patch.msgid.link/9a46d10d-e4e3-40a5-8fb6-f4637959f124@stanley.mountain Fixes: ff60bfbaf67f ("can: rockchip_canfd: add driver for Rockchip CAN-FD controller") Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> --- drivers/net/can/rockchip/rockchip_canfd-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)