net/dpaa2: fix incorrect loop increment

Message ID 20190425133456.23074-1-shreyansh.jain@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/dpaa2: fix incorrect loop increment |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS
ci/intel-Performance-Testing success Performance Testing PASS

Commit Message

Shreyansh Jain April 25, 2019, 1:34 p.m. UTC
  Identified by LGTM, the loop was incorrectly incrementing a different
variable and conditional on another.

Fixes: fe2b986ac662 ("net/dpaa2: support generic flow")
Cc: sunil.kori@nxp.com

Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
---
 drivers/net/dpaa2/dpaa2_flow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ferruh Yigit April 25, 2019, 3:49 p.m. UTC | #1
On 4/25/2019 2:34 PM, Shreyansh Jain wrote:
> Identified by LGTM, the loop was incorrectly incrementing a different
> variable and conditional on another.
> 
> Fixes: fe2b986ac662 ("net/dpaa2: support generic flow")
> Cc: sunil.kori@nxp.com
> 
> Suggested-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>

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

Patch

diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c
index 98f68139b..9ef46d47e 100644
--- a/drivers/net/dpaa2/dpaa2_flow.c
+++ b/drivers/net/dpaa2/dpaa2_flow.c
@@ -1734,7 +1734,7 @@  dpaa2_dev_verify_patterns(struct dpaa2_dev_priv *dev_priv,
 	/* more	than DPKG_MAX_NUM_OF_EXTRACTS. Verify this limitation too. */
 	for (i = 0; pattern[i].type != RTE_FLOW_ITEM_TYPE_END; i++) {
 		for (j = 0; j < MAX_TCS + 1; j++) {
-				for (k = 0; k < DPKG_MAX_NUM_OF_EXTRACTS; j++) {
+				for (k = 0; k < DPKG_MAX_NUM_OF_EXTRACTS; k++) {
 					if (dev_priv->pattern[j].pattern_type[k] == pattern[i].type)
 						break;
 				}