[1/3] app/test: fix control flow issue

Message ID 20231010062304.205933-2-chaoyong.he@corigine.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series Fix three coverity issues of bond PMD |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Chaoyong He Oct. 10, 2023, 6:23 a.m. UTC
  From: Long Wu <long.wu@corigine.com>

CI found that execution cannot reach the expression "-1"
inside this statement.

Coverity issue: 403097
Fixes: 5e41ab250dfa ("app/test: unit tests for bonding mode 4")
Cc: tomaszx.kulasek@intel.com
Cc: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 app/test/test_link_bonding_mode4.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Ferruh Yigit Oct. 31, 2023, 2:51 p.m. UTC | #1
On 10/10/2023 7:23 AM, Chaoyong He wrote:
> From: Long Wu <long.wu@corigine.com>
> 
> CI found that execution cannot reach the expression "-1"
> inside this statement.
> 
> Coverity issue: 403097
> Fixes: 5e41ab250dfa ("app/test: unit tests for bonding mode 4")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Long Wu <long.wu@corigine.com>
> Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
> Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
>

Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>

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

Patch

diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index 645fc1e0d4..ff13dbed93 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -641,8 +641,7 @@  bond_handshake(void)
 	/* If response didn't send - report failure */
 	TEST_ASSERT_EQUAL(all_members_done, 1, "Bond handshake failed\n");
 
-	/* If flags doesn't match - report failure */
-	return all_members_done == 1 ? TEST_SUCCESS : TEST_FAILED;
+	return TEST_SUCCESS;
 }
 
 #define TEST_LACP_MEMBER_COUT RTE_DIM(test_params.member_ports)