j1939_xtp_rx_rts() is called only in cases: - J1939_ETP_CMD_RTS, extd == 1 - J1939_TP_CMD_RTS, extd == 0 - J1939_TP_CMD_BAM, extd == 0 it means, this test is: if (J1939_ETP_CMD_RTS || !J1939_TP_CMD_BAM) or (J1939_ETP_CMD_RTS || J1939_TP_CMD_RTS) it is enough to test !J1939_TP_CMD_BAM Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> --- net/can/j1939/transport.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index 2ccb1f448d91..7652e129c804 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -1099,10 +1099,9 @@ static void j1939_xtp_rx_rts(struct j1939_priv *priv, struct sk_buff *skb, j1939_tp_set_rxtimeout(session, 1250); - if (j1939_tp_im_receiver(session->skb)) { - if (extd || dat[0] != J1939_TP_CMD_BAM) - j1939_tp_schedule_txtimer(session, 0); - } + if ((dat[0] != J1939_TP_CMD_BAM) && + j1939_tp_im_receiver(session->skb)) + j1939_tp_schedule_txtimer(session, 0); out_session_put: j1939_session_put(session); -- 2.19.1