From 795acf020e5c3b082219ed5b73036dcb48ca55d6 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 6 Dec 2016 09:01:43 +0800 Subject: [PATCH] lwiperf: Simplify #if LWIPERF_CHECK_RX_DATA guard The variable i is equal to q->len after exit the for loop. Check the received data should not change the logic of update packet_idx. So let's simplify the code a bit. Signed-off-by: Axel Lin --- src/apps/lwiperf/lwiperf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/apps/lwiperf/lwiperf.c b/src/apps/lwiperf/lwiperf.c index 3bdd01c7..079dd6b1 100644 --- a/src/apps/lwiperf/lwiperf.c +++ b/src/apps/lwiperf/lwiperf.c @@ -494,10 +494,8 @@ lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err) return ERR_VAL; } } - packet_idx += i; -#else - packet_idx += q->len; #endif + packet_idx += q->len; } LWIP_ASSERT("count mismatch", packet_idx == p->tot_len); conn->bytes_transferred += packet_idx;