[dpdk-dev,07/10] net: fix missing break inside conditional compile block

Message ID 20170504153822.19461-8-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Bruce Richardson May 4, 2017, 3:38 p.m. UTC
  The #ifdef only had the break in the else leg rather than in the first leg,
leading to the value set their being overridden on fall-through.

Fixes: 986ff526fb84 ("net: add CRC computation API")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_net/rte_net_crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jasvinder Singh May 5, 2017, 9:28 a.m. UTC | #1
-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
Sent: Thursday, May 4, 2017 4:38 PM
To: dev@dpdk.org
Cc: Richardson, Bruce <bruce.richardson@intel.com>
Subject: [dpdk-dev] [PATCH 07/10] net: fix missing break inside conditional compile block

The #ifdef only had the break in the else leg rather than in the first leg, leading to the value set their being overridden on fall-through.

Fixes: 986ff526fb84 ("net: add CRC computation API")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Jasvinder Singh <jasvinder.singh@intel.com>
  

Patch

diff --git a/lib/librte_net/rte_net_crc.c b/lib/librte_net/rte_net_crc.c
index e8326fe..9d1ee63 100644
--- a/lib/librte_net/rte_net_crc.c
+++ b/lib/librte_net/rte_net_crc.c
@@ -167,8 +167,8 @@  rte_net_crc_set_alg(enum rte_net_crc_alg alg)
 		handlers = handlers_sse42;
 #else
 		alg = RTE_NET_CRC_SCALAR;
-		break;
 #endif
+		break;
 	case RTE_NET_CRC_SCALAR:
 	default:
 		handlers = handlers_scalar;