[dpdk-dev,2/5] net/mlx5: remove unessecary goto label

Message ID 1483890123-4854-2-git-send-email-eladpe@mellanox.com
State Changes Requested, archived
Delegated to: Ferruh Yigit
Headers show

Checks

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

Commit Message

Elad Persiko Jan. 8, 2017, 3:42 p.m.
use_dseg label can be deleted as it happens without goto.

Signed-off-by: Elad Persiko <eladpe@mellanox.com>
---
 drivers/net/mlx5/mlx5_rxtx.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

Comments

Ferruh Yigit Jan. 9, 2017, 12:29 p.m. | #1
On 1/8/2017 3:42 PM, Elad Persiko wrote:
> use_dseg label can be deleted as it happens without goto.
> 
> Signed-off-by: Elad Persiko <eladpe@mellanox.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Patch

diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c
index be38aed..1560530 100644
--- a/drivers/net/mlx5/mlx5_rxtx.c
+++ b/drivers/net/mlx5/mlx5_rxtx.c
@@ -505,7 +505,6 @@ 
 				if ((uintptr_t)dseg >= end)
 					dseg = (volatile rte_v128u32_t *)
 					       txq->wqes;
-				goto use_dseg;
 			} else if (!segs_n) {
 				goto next_pkt;
 			} else {
@@ -523,19 +522,18 @@ 
 			dseg = (volatile rte_v128u32_t *)
 				((uintptr_t)wqe + (3 * MLX5_WQE_DWORD_SIZE));
 			ds = 3;
-use_dseg:
-			/* Add the remaining packet as a simple ds. */
-			addr = htonll(addr);
-			*dseg = (rte_v128u32_t){
-				htonl(length),
-				txq_mp2mr(txq, txq_mb2mp(buf)),
-				addr,
-				addr >> 32,
-			};
-			++ds;
-			if (!segs_n)
-				goto next_pkt;
 		}
+		/* Add the remaining packet as a simple ds. */
+		addr = htonll(addr);
+		*dseg = (rte_v128u32_t){
+			htonl(length),
+			txq_mp2mr(txq, txq_mb2mp(buf)),
+			addr,
+			addr >> 32,
+		};
+		++ds;
+		if (!segs_n)
+			goto next_pkt;
 next_seg:
 		assert(buf);
 		assert(ds);