diff options
author | 2017-02-01 12:31:41 -0600 | |
---|---|---|
committer | 2017-02-02 17:32:27 +0000 | |
commit | 56c7b01e163c233030359781d7e60f4553e90c51 (patch) | |
tree | 6d6ce1f179fdbfa2c2919ac082984fd0bf426f7f /src/plugins/ioam/lib-trace | |
parent | 1f9191f6efa5f2e0284c194f920093201b27ef81 (diff) |
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 <jdl@netgate.com>
Diffstat (limited to 'src/plugins/ioam/lib-trace')
-rw-r--r-- | src/plugins/ioam/lib-trace/trace_test.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index d1fb7205..1e287dee 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; } /* |