[dpdk-dev] net/i40e: remove redundant statement and braces

Message ID 1483969732-20073-1-git-send-email-wang.yong19@zte.com.cn (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Yong Wang Jan. 9, 2017, 1:48 p.m. UTC
  In function "reassemble_packets()", the statement "end = secondlast;"
is redundant since there is another assignment "start = end = NULL;"
3 lines below. BTW, I removed the redundant braces in the conditional
statement "if (end->data_len > rxq->crc_len)".

Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
---
 drivers/net/i40e/i40e_rxtx_vec_common.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Ferruh Yigit Jan. 9, 2017, 1:30 p.m. UTC | #1
On 1/9/2017 1:48 PM, Yong Wang wrote:
> In function "reassemble_packets()", the statement "end = secondlast;"
> is redundant since there is another assignment "start = end = NULL;"
> 3 lines below. BTW, I removed the redundant braces in the conditional
> statement "if (end->data_len > rxq->crc_len)".
> 
> Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
  
Ferruh Yigit Jan. 9, 2017, 1:31 p.m. UTC | #2
On 1/9/2017 1:30 PM, Ferruh Yigit wrote:
> On 1/9/2017 1:48 PM, Yong Wang wrote:
>> In function "reassemble_packets()", the statement "end = secondlast;"
>> is redundant since there is another assignment "start = end = NULL;"
>> 3 lines below. BTW, I removed the redundant braces in the conditional
>> statement "if (end->data_len > rxq->crc_len)".
>>
>> Signed-off-by: Yong Wang <wang.yong19@zte.com.cn>
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/i40e/i40e_rxtx_vec_common.h b/drivers/net/i40e/i40e_rxtx_vec_common.h
index 6cb5dce..02d834a 100644
--- a/drivers/net/i40e/i40e_rxtx_vec_common.h
+++ b/drivers/net/i40e/i40e_rxtx_vec_common.h
@@ -65,9 +65,9 @@ 
 				start->ol_flags = end->ol_flags;
 				/* we need to strip crc for the whole packet */
 				start->pkt_len -= rxq->crc_len;
-				if (end->data_len > rxq->crc_len) {
+				if (end->data_len > rxq->crc_len)
 					end->data_len -= rxq->crc_len;
-				} else {
+				else {
 					/* free up last mbuf */
 					struct rte_mbuf *secondlast = start;
 
@@ -77,7 +77,6 @@ 
 							end->data_len);
 					secondlast->next = NULL;
 					rte_pktmbuf_free_seg(end);
-					end = secondlast;
 				}
 				pkts[pkt_idx++] = start;
 				start = end = NULL;