From 56c7b01e163c233030359781d7e60f4553e90c51 Mon Sep 17 00:00:00 2001 From: Jon Loeliger Date: Wed, 1 Feb 2017 12:31:41 -0600 Subject: Refactor fragile msg macro W and W2 to not burry return control flow. Instead, have them accept and assign a return paramter leaving the return control flow up to the caller. Clean up otherwise misleading returns present even after "NOT REACHED" comments. Change-Id: I0861921f73ab65d55b95eabd27514f0129152723 Signed-off-by: Jon Loeliger --- src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c') diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index 3e7300f5dd2..80e656448c6 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -108,6 +108,7 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) int has_trace_option = 0; int has_pow_option = 0; int has_ppc_option = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -132,9 +133,8 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) S (mp); - W; - - return (0); + W (ret); + return ret; } @@ -142,11 +142,12 @@ static int api_vxlan_gpe_ioam_disable (vat_main_t * vam) { vl_api_vxlan_gpe_ioam_disable_t *mp; + int ret; M (VXLAN_GPE_IOAM_DISABLE, mp); S (mp); - W; - return 0; + W (ret); + return ret; } static int @@ -161,6 +162,7 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -238,9 +240,8 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - return (0); + W (ret); + return ret; } static int @@ -255,6 +256,7 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -332,9 +334,8 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - return 0; + W (ret); + return ret; } static int @@ -347,6 +348,7 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -401,9 +403,8 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - return (0); + W (ret); + return ret; } static int @@ -416,6 +417,7 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; + int ret; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -469,10 +471,8 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) mp->is_ipv6 = ipv6_set; S (mp); - W; - - - return (0); + W (ret); + return ret; } /* -- cgit 1.2.3-korg