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-trace/trace_test.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/plugins/ioam/lib-trace/trace_test.c') diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index d1fb7205ad2..1e287deede4 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -125,10 +125,10 @@ api_trace_profile_add (vat_main_t * vam) vl_api_trace_profile_add_t *mp; u8 trace_type = 0; u8 num_elts = 0; - int rv = 0; u32 node_id = 0; u32 app_data = 0; u8 trace_tsp = 0; + int ret; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -157,9 +157,8 @@ api_trace_profile_add (vat_main_t * vam) mp->num_elts = num_elts; S (mp); - W; - - return (rv); + W (ret); + return ret; } @@ -168,22 +167,24 @@ static int api_trace_profile_del (vat_main_t * vam) { vl_api_trace_profile_del_t *mp; + int ret; M (TRACE_PROFILE_DEL, mp); S (mp); - W; - return 0; + W (ret); + return ret; } static int api_trace_profile_show_config (vat_main_t * vam) { vl_api_trace_profile_show_config_t *mp; + int ret; M (TRACE_PROFILE_SHOW_CONFIG, mp); S (mp); - W; - return 0; + W (ret); + return ret; } /* -- cgit 1.2.3-korg